Initializing empty values from a widget

2
We are trying to build a new date picker widget however we are having some trouble with setting the value of the date to empty. If MxObject.setAttribute(null) is used it generates a new Date(0) thus 01/01/1970. How can a date be cleared and set to empty?
asked
2 answers
3

If you would like to set date to an empty value use empty string for that MxObject.setAttribute("dateAttr","").

Setting attribute value to "null" is not recommended since "null" values are used to determinate if attribute was ever filled or not.

answered
0

What do you mean by an empty date? Date is a primitive, like a boolean, and should never be empty. If you need something like a 'empty date' you might just use Epoch (01/01/1970) for that.

answered