- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2017 11:29 PM
In scoped application development, How to manipulate date field value to add number of days .
Tried Using below code in Ui action, to add number of days to start date which is not working .
var temp_date=this.getParameter('start_date');
var s_date= new GlideDateTime();
s_date.setValue(temp_date);
var end_date= new GlideDateTime();
end_date.setValue(temp_date);
gs.addInfoMessage('start date',s_date);
var days=g_form.getValue('number_of_days');
end_date.addDaysLocalTime(days);
g_form.setValue('wo_end_date',temp_date);
We want to add number of days to start date to calculate end date .Kindly suggest some solution .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2017 05:51 AM
Hi Mamatha,
GlideDateTime is not available on Client Side, it is only available on the Server Side.
So what you can do is make your End_Date_Field readonly, provide the number of days in Number_of_days, Save.
Make one Before BR and pass the values there-->
var _noofDays = parseInt('current.getValue('number_of_days');
var _start = current.getValue('start_date_field');
var _end = new GlideDateTime(_start);
_end.addDaysLocalTime(_noofDays);
current.setValue('end_date_field',_end);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2017 08:43 PM
Hi Mamatha,
If that answers your query would you be kind enough to mark my answer Correct and close the thread.
