I have the following field validator object:
{ type:'date', 'min':new Date() }
I was hoping that I could store new Date()
as an expression in JSON and it would be executed when it's parsed
save the timestamp:
{ type:'date', 'min':(new Date()).getTime() }
then you read it back:
var result = JSON.parse('{ "type":"date", "min":1234567 }');
result.date = new Date(result.min);
Note: the server you use to serialize it and the server you use to deserialize it has to run in the same timezone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With