- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2017 10:22 PM
1.Quarter number
2.Current number
Display Quarter number based on date
Ex: Jan to march Between related dates Display Quarter -1
April to June Between related dates Display Quarter -3 etc.
Ex:
now Current date: 2017-01-20 week: Quarter-1;
now Current date:2017-05-14 week: Quarter-2
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2017 12:22 AM
remove current.update()
var check= current.u_another_open;
var test = new GlideDateTime(check);
var mn = test.getMonth();
var quar = Math.ceil(mn/3);
gs.log('hellosssssss'+quar);
current.u_dateee=quar;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2018 12:22 PM
Hi Divya Mishra ,
it is working fine,
How can we able to write on week , i mean when i select a date then display that week of date
Ex: 02-01-2018 so then display WW1
17-01-201 so then display WW3
like this

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2020 06:12 AM
Year Quarter calculation form Client side
All Above Solution Are Provide For Server Side I am Giving Solution "Client Script" as well "Catalog Client Script" on onLoad() Function
function onLoad() {
//Type appropriate comment here, and begin script below
//alert(fecha);
var today_date = new Date();
var today_date_str = formatDate(today_date, g_user_date_format).toString();
var array = today_date_str.split("-");
var month = array[1].toString();
if (month == "01" || month == "02" || month == "03") {
g_form.setValue('variables.test', "Quetr-1");
g_form.setValue('variables.quter', 1);
} else if (month == "04" || month == "05" || month == "06") {
g_form.setValue('variables.test', "Quetr-2");
g_form.setValue('variables.quter', 2);
} else if (month == "07" || month == "08" || month == "09") {
g_form.setValue('variables.test', "Quetr-3");
g_form.setValue('variables.quter', 3);
} else if (month == "10" || month == "11" || month == "12") {
g_form.setValue('variables.test', "Quetr-4");
g_form.setValue('variables.quter', 4);
}
}
"Please mark Helpful given Solution is Correct"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2020 10:07 AM
Thank you