mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
updates to date time pickers
- make them behave better as inline elements for hgroup support - respect minInclusive, maxInclusive, minExclusive and maxExclusive restrictions for date types. no support in dojo to support the same with the TimePicker. addresses feature request WCM-379. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5574 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -590,7 +590,7 @@ dojo.declare("alfresco.xforms.TextField",
|
||||
: -1);
|
||||
this._length = (_hasAttribute(this.xformsNode, alfresco.xforms.constants.ALFRESCO_PREFIX + ":length")
|
||||
? Number(this.xformsNode.getAttribute(alfresco.xforms.constants.ALFRESCO_PREFIX + ":length"))
|
||||
: -1)
|
||||
: -1);
|
||||
|
||||
},
|
||||
{
|
||||
@@ -1455,6 +1455,14 @@ dojo.declare("alfresco.xforms.DatePicker",
|
||||
function(xform, xformsNode)
|
||||
{
|
||||
dojo.require("dojo.widget.DatePicker");
|
||||
this._minInclusive = (_hasAttribute(this.xformsNode, alfresco.xforms.constants.ALFRESCO_PREFIX + ":minInclusive")
|
||||
? this.xformsNode.getAttribute(alfresco.xforms.constants.ALFRESCO_PREFIX + ":minInclusive")
|
||||
: null);
|
||||
this._maxInclusive = (_hasAttribute(this.xformsNode, alfresco.xforms.constants.ALFRESCO_PREFIX + ":maxInclusive")
|
||||
? this.xformsNode.getAttribute(alfresco.xforms.constants.ALFRESCO_PREFIX + ":maxInclusive")
|
||||
: null);
|
||||
|
||||
// XXXarielb - change to a static
|
||||
this._noValueSet = (alfresco.xforms.constants.resources["eg"] + " " +
|
||||
dojo.date.format(new Date(),
|
||||
{datePattern: alfresco.xforms.constants.DATE_FORMAT,
|
||||
@@ -1466,11 +1474,19 @@ dojo.declare("alfresco.xforms.DatePicker",
|
||||
var datePickerDiv = document.createElement("div");
|
||||
this.domNode.parentNode.appendChild(datePickerDiv);
|
||||
|
||||
var dp_initial_value = this.getValue() || dojo.date.toRfc3339(new Date());
|
||||
var dp_initial_value = this.getValue() || null; //dojo.date.toRfc3339(new Date());
|
||||
var datePickerProperties = { value: dp_initial_value };
|
||||
if (this._minInclusive)
|
||||
{
|
||||
datePickerProperties.startDate = this._minInclusive;
|
||||
}
|
||||
if (this._maxInclusive)
|
||||
{
|
||||
datePickerProperties.endDate = this._maxInclusive;
|
||||
}
|
||||
|
||||
this.widget.picker = dojo.widget.createWidget("DatePicker",
|
||||
{
|
||||
value: dp_initial_value
|
||||
},
|
||||
datePickerProperties,
|
||||
datePickerDiv);
|
||||
this.domContainer.style.height =
|
||||
Math.max(this.widget.picker.domNode.offsetHeight +
|
||||
|
Reference in New Issue
Block a user