mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 09:58:04 +02:00
et2_widget_date-> datetime:Fix replacement of entered time manually with actuall time
This commit is contained in:
parent
9523ba79c2
commit
c1683552ba
@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class which implements the "date" XET-Tag
|
* Class which implements the "date" XET-Tag
|
||||||
*
|
*
|
||||||
* @augments et2_inputWidget
|
* @augments et2_inputWidget
|
||||||
*/
|
*/
|
||||||
var et2_date = et2_inputWidget.extend(
|
var et2_date = et2_inputWidget.extend(
|
||||||
{
|
{
|
||||||
attributes: {
|
attributes: {
|
||||||
@ -44,7 +44,7 @@ var et2_date = et2_inputWidget.extend(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @memberOf et2_date
|
* @memberOf et2_date
|
||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
@ -104,6 +104,11 @@ var et2_date = et2_inputWidget.extend(
|
|||||||
d.setHours(inst.hour);
|
d.setHours(inst.hour);
|
||||||
d.setMinutes(inst.minute);
|
d.setMinutes(inst.minute);
|
||||||
}
|
}
|
||||||
|
else if(inst && (typeof inst.hour === 'undefined'))
|
||||||
|
{
|
||||||
|
d.setHours(inst.settings.timepicker.hour);
|
||||||
|
d.setMinutes(inst.settings.timepicker.minute);
|
||||||
|
}
|
||||||
self.set_value(d);
|
self.set_value(d);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -258,7 +263,7 @@ var et2_date_duration = et2_date.extend(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @memberOf et2_date_duration
|
* @memberOf et2_date_duration
|
||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
@ -288,7 +293,7 @@ var et2_date_duration = et2_date.extend(
|
|||||||
},
|
},
|
||||||
this.createInputWidget();
|
this.createInputWidget();
|
||||||
},
|
},
|
||||||
|
|
||||||
createInputWidget: function() {
|
createInputWidget: function() {
|
||||||
// Create nodes
|
// Create nodes
|
||||||
this.node = $j(document.createElement("span"));
|
this.node = $j(document.createElement("span"));
|
||||||
@ -425,7 +430,7 @@ var et2_date_duration = et2_date.extend(
|
|||||||
|
|
||||||
return {value: _value, unit:_unit};
|
return {value: _value, unit:_unit};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change displayed value into storage value and return
|
* Change displayed value into storage value and return
|
||||||
*/
|
*/
|
||||||
@ -476,7 +481,7 @@ var et2_date_duration_ro = et2_date_duration.extend([et2_IDetachedDOM],
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Code for implementing et2_IDetachedDOM
|
* Code for implementing et2_IDetachedDOM
|
||||||
* Fast-clonable read-only widget that only deals with DOM nodes, not the widget tree
|
* Fast-clonable read-only widget that only deals with DOM nodes, not the widget tree
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -516,7 +521,7 @@ var et2_date_duration_ro = et2_date_duration.extend([et2_IDetachedDOM],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(typeof _values.value !== 'undefined')
|
if(typeof _values.value !== 'undefined')
|
||||||
{
|
{
|
||||||
_values.value = parseFloat(_values.value);
|
_values.value = parseFloat(_values.value);
|
||||||
}
|
}
|
||||||
if(_values.value)
|
if(_values.value)
|
||||||
@ -534,7 +539,7 @@ et2_register_widget(et2_date_duration_ro, ["date-duration_ro"]);
|
|||||||
* et2_date_ro is the readonly implementation of some date widget.
|
* et2_date_ro is the readonly implementation of some date widget.
|
||||||
* @augments et2_valueWidget
|
* @augments et2_valueWidget
|
||||||
*/
|
*/
|
||||||
var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Ignore all more advanced attributes.
|
* Ignore all more advanced attributes.
|
||||||
@ -561,7 +566,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @memberOf et2_date_ro
|
* @memberOf et2_date_ro
|
||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
@ -620,7 +625,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
display = date(this.egw().preference('timeformat') == '24' ? 'H:i' : 'g:i a', this.date);
|
display = date(this.egw().preference('timeformat') == '24' ? 'H:i' : 'g:i a', this.date);
|
||||||
break;
|
break;
|
||||||
case "date-time":
|
case "date-time":
|
||||||
display = date(this.egw().preference('dateformat') + " " +
|
display = date(this.egw().preference('dateformat') + " " +
|
||||||
(this.egw().preference('timeformat') == '24' ? 'H:i' : 'g:i a'), this.date);
|
(this.egw().preference('timeformat') == '24' ? 'H:i' : 'g:i a'), this.date);
|
||||||
break;
|
break;
|
||||||
case "date-since":
|
case "date-since":
|
||||||
@ -689,7 +694,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
this.span = jQuery(_nodes[0]);
|
this.span = jQuery(_nodes[0]);
|
||||||
this.set_value(_values["value"]);
|
this.set_value(_values["value"]);
|
||||||
|
|
||||||
if(_values["class"])
|
if(_values["class"])
|
||||||
{
|
{
|
||||||
this.span.addClass(_values["class"]);
|
this.span.addClass(_values["class"]);
|
||||||
}
|
}
|
||||||
@ -709,7 +714,7 @@ var et2_date_timeonly_ro = et2_date_ro.extend(
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Construtor
|
* Construtor
|
||||||
*
|
*
|
||||||
* @param _value
|
* @param _value
|
||||||
* @memberOf et2_date_timeonly_ro
|
* @memberOf et2_date_timeonly_ro
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user