What am I missing

Why is it that I can read the month of a global date object xyz:

m = globals.xyz.getMonth(); 

but cannot write it back with:

globals.xyz.setMonth(11);

Instead I have to go via a local date object:

var d = globals.xyz.getMonth();
d.setMonth(11);
globals.xyz = d;

It’s late so be gentle…

there is currently no other way to handle dates.
Because globals.XXXX (or the form dataproviders) are the bridges from/to javascript and the servoy system
And we need to see changes so with strings and numbers this does happen because there is no other way then globals.xxxx = yyy;

But strings are mutable objects so we don’t know if you do setMonth() on a global. So we don’t see any changes, so ui is not updated, relations aren’t update ect.

So we need to force a globals.xxxx = yyy for everything.