trigger issue with moment.min.js in desktop edition only

58 views
Skip to first unread message

roberto dal maso

unread,
Jan 15, 2017, 10:49:54 AM1/15/17
to mementodatabase
Hi all,
I have this little trigger to fill a date field (updating an entry - before saving):

if (entry().field("lavorate")) {
var t = moment();
t = moment(t).format('DD/MM/YY');

entry().set("data lav.ne", t);
}
else {
entry().set("data lav.ne", "");
}

Javascript library moment.min.js is flagged.

It works in android edition (4.1.0) but not in desktop ed. (1.0.7 - windows 10); the output is the following:

What am I doing wrong?
thanks
Auto Generated Inline Image 1

Bill Crews

unread,
Jan 15, 2017, 5:16:45 PM1/15/17
to mementodatabase
I'm not sure how field("says lav.ne") is defined -- probably as a Time or DateTime field. Whatever it is, it doesn't want to receive a string value that doesn't translate into a Time or DateTime format. Maybe "" will work (no space).

roberto dal maso

unread,
Jan 15, 2017, 5:57:08 PM1/15/17
to mementodatabase
Thanks for help Bill.
Field "data lav.ne" is a date field; I've tried to change its name with no "." and no spaces (now its name is "data_lavor") but does not work. I've tried to do what you suggest but still doesn't work.
What is strange is that in Android version it works great and, when the field "data_lavor" is automatically filled by the trigger in Android version it syncs perfectly to desktop version (I was thinking it could be a date format problem in the trigger or a locale problem).


roberto dal maso

unread,
Jan 16, 2017, 7:19:06 AM1/16/17
to mementodatabase
"In the desktop version method set() can't clear date field.
I will fix it in the next update."

Admin's words

Reply all
Reply to author
Forward
0 new messages