DateTextbox.js
资源名称:oa.rar [点击查看]
上传用户:kimgenplus
上传日期:2016-06-05
资源大小:20877k
文件大小:2k
源码类别:
OA系统
开发平台:
Java
- /*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
- http://dojotoolkit.org/community/licensing.shtml
- */
- dojo.provide("dojo.widget.DateTextbox");
- dojo.require("dojo.widget.ValidationTextbox");
- dojo.require("dojo.date.format");
- dojo.require("dojo.validate.datetime");
- dojo.widget.defineWidget("dojo.widget.DateTextbox", dojo.widget.ValidationTextbox, {displayFormat:"", formatLength:"short", mixInProperties:function (localProperties) {
- dojo.widget.DateTextbox.superclass.mixInProperties.apply(this, arguments);
- if (localProperties.format) {
- this.flags.format = localProperties.format;
- }
- }, isValid:function () {
- if (this.flags.format) {
- dojo.deprecated("dojo.widget.DateTextbox", "format attribute is deprecated; use displayFormat or formatLength instead", "0.5");
- return dojo.validate.isValidDate(this.textbox.value, this.flags.format);
- }
- return dojo.date.parse(this.textbox.value, {formatLength:this.formatLength, selector:"dateOnly", locale:this.lang, datePattern:this.displayFormat});
- }});
- dojo.widget.defineWidget("dojo.widget.TimeTextbox", dojo.widget.ValidationTextbox, {displayFormat:"", formatLength:"short", mixInProperties:function (localProperties) {
- dojo.widget.TimeTextbox.superclass.mixInProperties.apply(this, arguments);
- if (localProperties.format) {
- this.flags.format = localProperties.format;
- }
- if (localProperties.amsymbol) {
- this.flags.amSymbol = localProperties.amsymbol;
- }
- if (localProperties.pmsymbol) {
- this.flags.pmSymbol = localProperties.pmsymbol;
- }
- }, isValid:function () {
- if (this.flags.format) {
- dojo.deprecated("dojo.widget.TimeTextbox", "format attribute is deprecated; use displayFormat or formatLength instead", "0.5");
- return dojo.validate.isValidTime(this.textbox.value, this.flags);
- }
- return dojo.date.parse(this.textbox.value, {formatLength:this.formatLength, selector:"timeOnly", locale:this.lang, timePattern:this.displayFormat});
- }});