- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2019 08:31 AM
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
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.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2019 09:40 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2019 07:39 AM
This worked perfect! I just had to remove the - from the -1 so it went a day ahead. Thank you everyone!