%datetimeboxDTD; ]> "&date.year.placeholder;""&date.month.placeholder;""&date.day.placeholder;" max) { return true; } return false; ]]> this.getDaysInMonth(month, year)) { // Don't set invalid date, otherwise input element's value will be // set to empty. return; } let date = [year, month, day].join("-"); if (date == this.mInputElement.value) { return; } this.log("setInputValueFromFields: " + date); this.mInputElement.setUserInput(date); ]]> = targetField.maxLength || n * 10 > max) { buffer = ""; this.advanceToNextField(); } targetField.setAttribute("typeBuffer", buffer); } ]]> max) { value -= (max - min + 1); } else if (value < min) { value += (max - min + 1); } this.setFieldValue(aTargetField, value); aTargetField.select(); ]]> max) { value = max; } } if (aField == this.mMonthField || aField == this.mDayField) { // prepend zero if (value < 10) { value = "0" + value; } } else { // prepend zeroes if (value < 10) { value = "000" + value; } else if (value < 100) { value = "00" + value; } else if (value < 1000) { value = "0" + value; } if (value.toString().length > this.mYearLength && value.toString().length <= this.mMaxYear.toString().length) { this.mYearField.size = value.toString().length; } } aField.value = value; this.updateResetButtonVisibility(); ]]> = this.mMaxHourInHour12) ? this.mPMIndicator : this.mAMIndicator; } if (!this.isEmpty(second)) { let index = second.indexOf("."); let millisecond; if (index != -1) { millisecond = second.substring(index + 1); second = second.substring(0, index); } if (!this.mSecondField) { this.mSecondSeparator = this.insertSeparator(this.mSeparatorText); this.mSecondField = this.insertAdditionalField(this.mPlaceHolder, this.mMinSecond, this.mMaxSecond, this.mMaxLength, this.mMaxLength); } this.setFieldValue(this.mSecondField, second); if (!this.isEmpty(millisecond)) { if (!this.mMillisecField) { this.mMillisecSeparator = this.insertSeparator( this.mMillisecSeparatorText); this.mMillisecField = this.insertAdditionalField( this.mPlaceHolder, this.mMinMillisecond, this.mMaxMillisecond, this.mMillisecMaxLength, this.mMillisecMaxLength); } this.setFieldValue(this.mMillisecField, millisecond); } else if (this.mMillisecField) { this.mMillisecField.remove(); this.mMillisecField = null; this.mMillisecSeparator.remove(); this.mMillisecSeparator = null; } } else { if (this.mSecondField) { this.mSecondField.remove(); this.mSecondField = null; this.mSecondSeparator.remove(); this.mSecondSeparator = null; } if (this.mMillisecField) { this.mMillisecField.remove(); this.mMillisecField = null; this.mMillisecSeparator.remove(); this.mMillisecSeparator = null; } } this.notifyPicker(); ]]> = this.mMaxHourInHour12) ? this.mPMIndicator : this.mAMIndicator; } } if (!this.isEmpty(minute)) { this.setFieldValue(this.mMinuteField, minute); } // Update input element's .value if needed. this.setInputValueFromFields(); ]]> max) { value -= (max - min + 1); } else if (value < min) { value += (max - min + 1); } this.setFieldValue(aTargetField, value); aTargetField.select(); ]]> = targetField.maxLength || n * 10 > max) { buffer = ""; this.advanceToNextField(); } targetField.setAttribute("typeBuffer", buffer); } ]]> this.mMaxHourInHour12) ? value - this.mMaxHourInHour12 : value; if (aValue == "00") { value = this.mMaxHourInHour12; } } // prepend zero if (value < 10) { value = "0" + value; } } else if (aField.maxLength == this.mMillisecMaxLength) { // prepend zeroes if (value < 10) { value = "00" + value; } else if (value < 100) { value = "0" + value; } } aField.value = value; this.updateResetButtonVisibility(); ]]> { this.addEventListener(eventName, this, { mozSystemGroup: true }); }); // Handle keypress separately since we need to catch it on capturing. this.addEventListener("keypress", this, { capture: true, mozSystemGroup: true }); // This is to open the picker when input element is clicked (this // includes padding area). this.mInputElement.addEventListener("click", this, { mozSystemGroup: true }); ]]> { this.removeEventListener(eventName, this, { mozSystemGroup: true }); }); this.removeEventListener("keypress", this, { capture: true, mozSystemGroup: true }); this.mInputElement.removeEventListener("click", this, { mozSystemGroup: true }); this.mInputElement = null; ]]> return (aValue == undefined || 0 === aValue.length); throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NOT_IMPLEMENTED;