First check if, when you switch ‘myDateTimeAttribute’ to localized in Mendix, that your tests shows
'attribute is a LOCALIZED date'
But if that proves to be correct, I expect this to show a bug in Mendix in the passing of any date-attribute to widgets. Might want to open a ticket to Mendix for it, if this is reproducable.
This is the answer I got from Mendix Support about this behaviour:
Hopefully, you had a nice weekend. I've discussed your query with our internal team and found the following:
MxObject.set("MyAttribute", 0)
to work differently for a non-localized datetime attribute (which is a Mendix-specific concept) than a simple new Date(0)
.MxObject
(the new pluggable widget APIs deal with this transparently). The non-localized datetime attributes should be used where only the date part is relevant and the time part can be ignored. MxObject.set()
with a timestamp that corresponds with 1970-01-01 0:00 CET (in other words, new Date("1970-01-01 0:00").getTime()
, which is -3600000
if you're in the Europe/Amsterdam
timezone).While I understand that may not be what you expected, hopefully, this sheds some light on the situation.