> with what you currently have, the dateFormat(new Date(),"isoDate") code
> is run once (when your model is defined) and this is why the date in the
> instance is old - in fact it will be the same for every instance that gets
> the default value.
> fortunately, the "default" property can be a function that will be invoked
> for every instance that gets the default value.
> "default": function () { return dateFormat(new Date(),"isoDate"); }
> i believe that should work.
> thanks,
> ben...
> On Friday, July 13, 2012 8:36:18 AM UTC-4, W.S. Hager wrote:
>> Hi,
>> When I want to add a default value to the date property in my model, the
>> date returned is a stale one:
>> ...
>> dateFormat = require('dateformat');
>> ...
>> date:{
>> type:"string",
>> format:"date",
>> "default":dateFormat(new Date(),"isoDate")
>> },
>> ...
>> The date in the new instance is not the current date but two days ago.
>> When I restart persvr I get the current one. How can I fix this?
>> Thanks.
>> --
>> W.S. Hager
>> Lagua Web Solutions
>> http://lagua.nl
>> --
> You received this message because you are subscribed to the Google Groups
> "Persevere" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/persevere-framework/-/rBjR64u8FcQJ.
> To post to this group, send email to persevere-framework@googlegroups.com.
> To unsubscribe from this group, send email to
> persevere-framework+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/persevere-framework?hl=en.