Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

<sp-date-picker>

xiaix
Tera Guru

So we have this nice service portal widget date picker:

<sp-date-picker ng-model="data.datePicker" sn-change="customDate()"></sp-date-picker>

Do we have a date/time picker OOB?

 

 

1 ACCEPTED SOLUTION

J Trunnelle
Tera Expert

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

View solution in original post

5 REPLIES 5

J Trunnelle
Tera Expert

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

You're the hero of the day.  How did you come across that info?

Hi David, I first checked the sp_includes.js to even know it existed. 

File:   https://myinstance.service-now.com/scripts/js_includes_sp.js
  Section:    /*! RESOURCE: /scripts/app.$sp/directive.spDatePicker.js */

Looking in there, I see the template had the snIncludeTime:

 restrict: 'E',
 replace: true,
 require: '?ngModel',
 scope: {
 field: '=',
 snDisabled: '=',
 snIncludeTime: '=',
 snChange: '&'
},

Well, that makes sense.  And right along those same lines, you have any clues on this one?

<sp-date-picker> keeps throwing 'isInvalid' error everywhere