how to calculate no: of mondays / tuesdays / wednesdays ... etc in a month
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2022 01:43 AM
Hello team ,
I have a month field with drop down of months with values 1 - 12 , when I select a month ( ex :Jan ) and select 1st Monday , it should give me a count of how many Mondays are there in the selected month , and so on for Tuesday / wednesday ....
I tried this script , but it does not work .
var dt = "audit_month";
var gdt = new GlideDateTime(dt);
var day = gdt.getDayOfWeek();
var days = gdt.getDayOfMonthLocalTime();
if ((day == 1 || day==2 || day==3) && ((days >=1 && days <=7))) {
g_form.setValue("u_days", days);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 06:07 AM
Give me your requirement
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 06:18 AM
My requirement is when I select Monday , I should get the numbers Mondays in the current month , and so on for Tuesdays , wednesday.......... Saturdays .
I posted my question here and got directed to your solution
Re: How to find number of Mondays , Tuesdays.....S... - ServiceNow Community