Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Date Time Picker in Service Portal

aksm1
Kilo Contributor

I've found a date picker for service portal but I'm not sure how to set date time for the datepicker?         <sp-date-picker ng-model="your.model.value" sn-change=""></sp-date-picker>

2 REPLIES 2

Jon Barnes
Kilo Sage

in the html:



<sp-date-picker field="delivery" ng-model="delivery.value" ng-model-options="{getterSetter: true}" sn-disabled="false"></sp-date-picker>



somewhere in your client controller (the name must correspond to the "field" attribute on the sp-date-picker directive):



$scope.delivery = {


displayValue: '',


value: '',


name: 'delivery'


};



you can set the value/displayValue to something as a default if you want.


Ximizu
Mega Guru

Solution

I was able to use the same picker with time by adding the   sn-include-time="true"   parameter?

 

Source of the solution in this thread

https://community.servicenow.com/community?id=community_question&sys_id=36f7b0b7db2057843882fb651f9619b9