fix not working data arithmetic, after change from timestamps to strings in date widget

This commit is contained in:
Ralf Becker 2014-08-21 12:43:14 +00:00
parent cb4b0a9532
commit cfd28ae9a9

View File

@ -1244,7 +1244,6 @@ app.classes.calendar = AppJS.extend(
var alarm_date = this.et2.getWidgetById('new_alarm[date]'); var alarm_date = this.et2.getWidgetById('new_alarm[date]');
var alarm_options = _widget || this.et2.getWidgetById('new_alarm[options]'); var alarm_options = _widget || this.et2.getWidgetById('new_alarm[options]');
var start = this.et2.getWidgetById('start'); var start = this.et2.getWidgetById('start');
var date = 0;
if (alarm_date && alarm_options if (alarm_date && alarm_options
&& start) && start)
@ -1260,7 +1259,8 @@ app.classes.calendar = AppJS.extend(
var startDate = start.get_value(); var startDate = start.get_value();
if (startDate) if (startDate)
{ {
date = startDate - parseInt(alarm_options.get_value()); var date = new Date(startDate);
date.setTime(date.getTime() - parseInt(alarm_options.get_value()));
alarm_date.set_value(date); alarm_date.set_value(date);
} }
} }