Is it possible to have a date picker where only 1 day a month

davo2011
Tera Contributor

Scenario is I want a date picker with only 1 date to be selectable per month, so the other dates are greyed out.  Anyone any ideas?

davo2011_0-1737539868408.png

 

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@davo2011 

If they can select only 1 date always in the month then what's the point in asking them to select?

why not set the default value when form loads and make that variable/field readonly?

For example: if the current month is Jan and you wish to set 22nd as the date this is possible

if the current month is Feb and you wish to set 23rd then this is possible

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar  maybe my scenario wasn't clear enough.  The dates available to select could be random day that will be controlled somewhere else.  
I though that a choice list maybe the best option, it'd have probably reference a custom table like below, which denotes what dates can be available.  I was just hoping there was a simplish way of displaying this on a date picker rather than a a choice list

ActiveDate
FALSE20/01/2025
TRUE24/01/2025
TRUE01/01/2025
TRUE17/02/2025
TRUE02/03/2025
TRUE11/03/2025
TRUE30/03/2025

 

@davo2011 

2 ways

1) have onChange client script + GlideAjax and validate the selected date against the dates allowed

OR

2) Simply have choice list with those choices (easiest approach)

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yeah thats what I already expected so not really the solution I was after ☹️