Calc to convert number to a Date of the Month
Hi All, I feel this is quite a simple one but I'm brand new to Javascript but am now struggling with this one.  I'm wanting to simply enter a 'Payment Date', and then a calculation field to take that number and display it as an ordinal date. ie '1 -> 1st' or '2 -> 2nd' etcFor some reason, the current calculation displays 15 as the 1st and I don't know why. See image below. Does anyone have any suggestions? 

  • Rainer,  Thank you so much for your reply. You really are a legend in this community :) I've taken what you've done and actually adapted it to grab the information from a date field instead. However, regardless of where the information comes from, my table view in this app doesn't allow me to sort it by correct date order which is what I was hoping to achieve. I need it date order when sorted by ascending (1st, 5th, 11th, etc), instead of alphabetical order like its doing (1st, 11th, 2nd, 21st, etc)Would you have any idea how to accomplish this or is this a limitation of Podio?I've added screenshots if they can help explain. 
  • Hi Simon, you must tell the moment() function that @payment date is the day number part of a date.  Otherwise moment() doesn't know what it should parse. moment(@Payment Date, "D").format("Do")Another example: If you have e.g. the date formatted like 20190612 and you want to parse it to another format: moment(@field,"YYYYMMDD").format("MM/DD/YYYY") Rainer
This question is closed.