Help with Date field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 03:53 AM
Hello,
I have a date field on a catalog form. I basically need to get the value of the date in this field and today's date and then do some calculations. However, when I log the dates, I'm getting it in the wrong format and time zone. Screenshot attached, I need the scheduled date to show in the same format as todays date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 04:00 AM
Hi @User485076
Please check if below post is helpful :
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 04:04 AM
Hi Amit, I thought about using getDisplayValue. This would correctly log the scheduled date as DD/MM/YYYY. However, I'm also getting todays date, this isn't a field on the form. How can I alter the format here to be the same as the field on the form:
var today = new Date();
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 04:07 AM
@User485076 You will get today's date and you can format as per your requirement using below code.
var todayDate= new GlideDate();
todayDate.getByFormat("dd-mm-yyyy");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 04:09 AM
Hi Akshata,
Getting error: ReferenceError: GlideDate is not defined