Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2016 01:06 PM
I am trying to run a script include that will skip the weekend. I keep receiving an error on getDayOfWeek()
java.lang.NullPointerException
function checkDate(x) {
var gdt = new GlideDateTime(x);
var day = gdt.getDayOfWeek();
if (day == 1) {
return gdt < gs.daysAgo(3);
} else {
return gdt < gs.daysAgo(1);
}
}
Solved! Go to Solution.