Usind moment.js endOf
Hi,
I have used moment.js in calculation fields in Podio and want to use it to find a end of month moment.
I'm using
moment().endOf('month);
as described in moment.js docs http://momentjs.com/docs/#/manipulating/end-of/
I'm getting an error (script returned an unsupported tyep) http://puu.sh/lV877.png
Is it not possible to use endOf in Podio calculation fields?
-
... and if you don't want it as a text string but as a date (= displayed like a date field) you can use:
moment().endOf('month').toDate()
But then you have to take care about the right time. The function moment takes the Podio server time, so there can be a difference to your timezone. You have to add or subtract hours (depends if your timezone is UTC- or UTC+) like:
moment().endOf('month').add(5,'hours').toDate()
Rainer
Please sign in to leave a comment.
Comments
3 comments