- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
09-12-2019 10:49 AM
In ServiceCatalog Date variable I am getting current Year (2019 )using the below default value
javascript: var gdt = new GlideDateTime(gs.nowDateTime());gdt.getYear();
But I need to get 2020 as from ( ex May) a month fiscal year starts .
How to achieve that ?
解決済! 解決策の投稿を見る。
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
09-12-2019 12:04 PM
Try this code.
var gdt = new GlideDateTime(gs.nowDateTime());
if(gdt.getMonth()+1 <=3)
return gdt.getYear();
else
return gdt.getYear()+1;
Mark the comment as a correct answer and also helpful once worked.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
09-12-2019 12:04 PM
Try this code.
var gdt = new GlideDateTime(gs.nowDateTime());
if(gdt.getMonth()+1 <=3)
return gdt.getYear();
else
return gdt.getYear()+1;
Mark the comment as a correct answer and also helpful once worked.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
09-12-2019 01:42 PM
working fine but giving 2020.0

How to get rid of .0 ?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
11-03-2023 07:04 AM
@ragz - did you figure this out? Can you drop the javascript: value if so? Thanks
