How to check if the given date falls in current week and current month
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 10:23 PM
How to check if the given date falls in current week and current month
Using filter in encoded query as date on today or date on this month works as per the user time zone. But I want this be achieved via script and in IST time zone, I want to check if the date falls in current week or current month.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 10:50 PM
@Ankur Bawiskar I checked that link and addDays doesn't work in scoped application. I tried running that script in background.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 11:03 PM
for scoped app use addDaysUTC()
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 11:05 PM
@Ankur Bawiskar Yes I have used addDaysLocalTime and it gives me the start of the week and end of the week. but how to know if the given date falls in current month or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 11:37 PM
similar logic
get start date of the month and last date of the month, then check if your date falls in between those
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader