Skip to content

Commit

Permalink
[modxcms#9690] fix date math to work with fractional hour offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
netProphET committed Mar 27, 2013
1 parent 99cc3cc commit 1e68d96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions manager/assets/modext/util/datetime.js
Expand Up @@ -468,7 +468,7 @@ Ext.ux.form.DateTime = Ext.extend(Ext.form.Field, {
*/
,setDate:function(date) {
if (date && this.offset_time != 0) {
date = date.add(Date.HOUR, new Number(this.offset_time));
date = date.add(Date.MINUTE, 60 * new Number(this.offset_time));
}
this.df.setValue(date);
} // eo function setDate
Expand All @@ -479,7 +479,7 @@ Ext.ux.form.DateTime = Ext.extend(Ext.form.Field, {
*/
,setTime:function(date) {
if (date && this.offset_time != 0) {
date = date.add(Date.HOUR, new Number(this.offset_time));
date = date.add(Date.MINUTE, 60 * new Number(this.offset_time));
}
this.tf.setValue(date);
} // eo function setTime
Expand Down Expand Up @@ -643,7 +643,7 @@ Ext.ux.form.DateTime = Ext.extend(Ext.form.Field, {
if(this.isRendered) {
var value = '';
if (this.dateValue instanceof Date) {
value = this.dateValue.add(Date.HOUR, 0 - new Number(this.offset_time)).format(this.hiddenFormat);
value = this.dateValue.add(Date.MINUTE, 0 - 60 * new Number(this.offset_time)).format(this.hiddenFormat);
}
this.el.dom.value = value;
}
Expand Down

0 comments on commit 1e68d96

Please sign in to comment.