How to get current date time as default value in datetime field on Modal page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2024 02:59 AM - edited ‎02-08-2024 03:03 AM
We have a startTime(Date-Time) component on a modal page. The requirement is to set the current date time as the default value when the modal page opens. The user should be allowed to make changes to that startTime field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2024 03:49 AM
@Sai Kumar , Something like this
<g:ui_date_time name="end_date" id="end_date" value='${gs.nowDateTime()}'
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2024 03:51 AM - edited ‎02-08-2024 03:53 AM
hey @Sai Kumar, are you using a widget?
if so, maybe you can declare data.currentDate = new GlideDateTime(); in your server side code.
then you cal call it from html with something like:
<input style="margin-bottom: 25px;" id="typeYourID" class="typeYourClass" type="date" >{{data.currentDate}}</input >
No needing to be exactly like this, just giving an example.
have a nice day!