Can't set a Date prior 01/01/1970 in a Date field in a javascript trigger

26 views
Skip to first unread message

sacroimper

unread,
Jun 26, 2018, 6:09:11 PM6/26/18
to mementodatabase


Can't set a Date prior 01/01/1970 in a Date field in a javascript trigger.

I'm trying to copy the values from one entry to another.
I'm handling correctly all field types and the Date field works with a date post 01/01/1970.
But, if it is prior 1970, it throws an error like " Unparseable date : '-1594568' ".

// This is the code I use:

anotherEntry.set('Birth date', entry().field('Birth date'));

// also tried this with the same result:

anotherEntry.set('Birth date', moment(entry().field('Birth date')).toDate().getTime());


Is there another way to do this without creating string nor numeric fields to store the date?
Reply all
Reply to author
Forward
0 new messages