How to set Catalog item variable date/time to display short date/time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 01:16 PM
I want the Catalog Item variable of date/time (could be single line text) in the service portal to NOT show seconds or milliseconds.
I understand this can be set on the display for user preferences, however, two things, it is already set to not show seconds and I have found this is not applying it to the catalog item within the service portal and not in the notifications when it displays this variable.
I was looking at something like the below, but I don't see how I can apply this to the variable type date/time.
var gd = new GlideDate();
var displayValue = gd.getDisplayValue();
gs.info('Display Value: ' + displayValue); // Output: Display Value: 11-13-2023
or can I add this to my notification?
=FormatDateTime(variablename, DateFormat.ShortDate)
Thanks in advance.
Nick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 04:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 04:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 04:09 PM
Hello @SwathiSarang
Thank you for the reply, I got a java script error on the catalog item.
I want to include the catalog item view.
I really want this to apply to a Notification, I presume the variable with seconds at 00 will pass through.