Need help with sp-date-picker directive

AK57
Kilo Explorer

Can someone please give an example on using the sp-date-picker directive with sn-include-time=true ?

I have tried to use it but the server script never catches the values from the html. How should the client controller look like in order to get this working ?

Thanks.

13 REPLIES 13

In the html you can bind to the server variable with c.data.datePicker 

Hi Tommy,

Thanks for your reply. But I have to now ask... how do I do that? Ultimately I'm just trying to get to a place where the user can pick a date, the date sticks in the picker, and then I can make use of the date they've selected on the server side.

Try this html

<div>
<sp-date-picker field="c.data.datePicker" ng-model="c.data.datePicker" sn-change="customDate()" sn-include-time="true"></sp-date-picker>
</div>

Hi Tommy,

This gives the same result unfortunately. The selected date immediately disappears.

In your server script remove:

data.datePicker="";

 

and see if that is better