Nativescript datepicker - expected value


#1

Hello guys I have quick question, since there is no info, in the docs on the website …
What does datepicker expect at initialization,
https://docs.nativescript.org/cookbook/ui/date-picker
DateObject like new Date(), or ISO string- new Date().toIsoString(), or something else ???
also can I initialize Datepicker like
<DatePicker date = "{{ date }}" />


#2

It should be a JS Date object indeed. I guess that binding should work, although for my particular usage I set the date in the <DatePicker loaded=".."> event.


#3

Thanx, can you please share example of code how you are doing it,
because to it seems when a pass the Date, it doesnt trigger or update Model,
when Im setting it to todays date :slight_smile:


#4

Have a Playground. This one has 2 ways to bind the dates: https://play.nativescript.org/?template=play-tsc&id=zzuebT