Default date of Tomorrow on a date field

Nic Omaha
Tera Guru

I have a date field that I would like to default to tomorrows date. I can use javascript:gs.daysAgo(-1) as a default if the field is date/ time. 

If I use that on a field that is just "date" I get the following populated 

find_real_file.png

 

Any ideas on how I can fix this? I would love to use only the date and not have to see the time as well as it wont be used. 

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

gs.daysAgo() will always return the date in system format (yyyy-MM-dd). Use this in the default value and you should be good to go

 

javascript: var gdt = new GlideDateTime(); gdt.addDaysLocalTime(-1); gdt.getLocalDate();

View solution in original post

5 REPLIES 5

This worked perfect! I just had to remove the - from the -1 so it went a day ahead. Thank you everyone!