Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I created two Calendar Objects to update the variables and vStartDate and vEndDate. The variables are created in the script by
LET vStartDate =monthstart(today());
LET vEndDate =monthend(today());
When I look at the number representation of the vEndDate, I get a decimal number and not an integer? e.g. if I set both dates to 01.01.2018, the value of vStartDate is 43374 and the value of vEndDate is 43374.62... There are no other objects in the document that should affect the variables
Any idea why this is happening?
Can you share your sample app where you are seeing this?
Dates are stored internally as integers. To change the display format in the Calendar Object, set to Date on the Number format tab. The raw variable value will still be a date number, but it's still useful in date functions and arithmetic.
For consistency, you may want to use the number format in your script.
LET vStartDate =num(monthstart(today()));
Also, as MonthEnd also returns the time 23:59:59, you probably want to drop the time using floor().
LET vEndDate =floor(monthend(today()));
I'm not sure how you are getting 43374.62. from the Calendar object. .62 indicates you have a time in the value.
-Rob
Thanks!
For the record:
I think the problem was the Min Value and Max Value, as theese where derived from a timestamp and and therefore a decimal number. Added the floor(num()) functions both here and in the definition in the script, and it seems that it works correctly now.