Handlebar Help - Get the last day of the month

@thaodinh you could also just do some math do get what you need instead of needing to do a compare. The idea is to:

  • Get the first month of the current date. We know the first day of the month for the current date because it would be the current month and then 01.
  • After that, you add 32 days to the first date of the current month to get a date into the next month.
  • Then you get the first day of the next month.
  • Then you subtract 1 day to get the day before the first day of the next month which would be the same as the last day of the current month.
{{dateFormat "YYYY-MM-DD" (dateAdd (dateFormat "YYYY-MM-01" (dateAdd (dateFormat "YYYY-MM-01" (timestamp) "YYYY-MM-DDTHH:mm:ss.SSS[Z]") "2769000000") "YYYY-MM-DDTHH:mm:ss.SSS[Z]") "-86400000") "YYYY-MM-DDTHH:mm:ss.SSS[Z]"}}