- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2023 04:45 AM
Hi All,
I need to fetch 1st date and last date of the current month and set it to fields "start_date" and "end_date" field of the entitlement.
Can anyone help me on the code for the same.
Thanks,
Jaydee
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2023 07:50 AM
var currentTime = new Date();
var currentMonth = currentTime.getMonth();
var currentYear = currentTime.getFullYear();
var startDate = new Date(currentYear, currentMonth, 1);
var endDate = new Date(currentYear, currentMonth + 1, 0);
//Assuming the entitlement record is stored in the variable "entitlement"
entitlement.start_date = startDate;
entitlement.end_date = endDate;
entitlement.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2023 07:50 AM
var currentTime = new Date();
var currentMonth = currentTime.getMonth();
var currentYear = currentTime.getFullYear();
var startDate = new Date(currentYear, currentMonth, 1);
var endDate = new Date(currentYear, currentMonth + 1, 0);
//Assuming the entitlement record is stored in the variable "entitlement"
entitlement.start_date = startDate;
entitlement.end_date = endDate;
entitlement.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2023 01:12 AM
Thanks @Veer It worked.