Schedule Entry Start/End Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2016 12:22 PM
Hi, Community,
I am trying to get the start/end date in current year, for example, I have a schedule set as:
If I call schedule_entry.start_date_time, it returns '2014-10-21', which I actually want 2016-10-21.
Does anyone know if there is any oob function I can use to get the updated data? Or I have to calculate through custom script?
Any suggestion would be appreciated.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2016 12:53 PM
Solon,
If you want the same date (day and month) but with the current year, I don't know that there is an out of the box function to do that. The only way I'm familiar is with plain javascript.
Using "var gDate = new GlideDate();" for example would return "2016-01-21", the current date. If you wanted to take, say, "2014-04-13" and make it "2016-04-13" that would require some scripting.
Can you explain a little more about what you're trying to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2016 01:06 PM
Thank you Dylan.
I setup a yearly-repeating schedule entry, like the screenshot I attached. If I submit a form today (created_on: 2016-01-20), I would like to compare this 'Created_on' date with the schedule entry (should be 2016-01-21 in this year). However if I use schedule_entry.start_date_time it returns '2014-01-21".
I am wondering if there is a way I can get this year's date in this schedule without scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2016 02:05 PM
I haven't really used schedules much out of the box, so forgive me if I'm misunderstanding.
What I am trying to figure out is why you need to do a comparison on the year of the day specified in the schedule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2016 07:32 PM
OK, for example, we want all ticket with Start Date (u_start_date) in following time window to be marked as 'Emergency':
Dec 25 - Jan 3rd
July 4 - July 7
Sep 1 - Sep 3
System admin (with no scripting knowledge) should have the ability to add/edit time window entry, what would you suggest to do?
Thanks.