|
Struts example source code file (DateTextbox.js)
The Struts DateTextbox.js source code/* 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}); }}); Other Struts examples (source code examples)Here is a short list of links related to this Struts DateTextbox.js source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.