sp-date-picker validation on ServicePortal

Kalik2
Tera Expert

Kalik2_0-1670706255468.png

I have created start date and end date field using angular ng template using the below code.

 

<sp-date-picker
field="::spDatePickerConfig.startTime || {}"
ng-model="start.value"
sn-include-time="true"
sn-change="timeChange('start')">
</sp-date-picker>

 

I want that if the user selects a time outside office hours 9am-6pm , he should be asked to select time between office hours.

 

And if the user selects the time in the office hours but that time is already past, the next day's date should populate automatically.

How can I achieve this?

 

11 REPLIES 11

Kalik1_3-1670768890314.pngKalik1_4-1670768901828.png

 

Hi,

I know this is an old subject, but still can't understand why  i can't find the start object definition  in your code?  Could you help me please understand where the  start variable is defined?