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:
Ariel Backenroth
2007-04-28 21:34:15 +00:00
parent 1b898fb23e
commit 172b86dab4
3 changed files with 124 additions and 10 deletions

View File

@@ -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 +