Showing 179 scripts

Sort by name or size

Any+Time Date/Time Library: ATWidget Picker and ATConverter Parse/Format Utility

Any+Time Date/Time Library: ATWidget Picker and ATConverter Parse/Format Utility

The Any+Time™ JavaScript Library contains an easy-to-use, easy-to-customize calendar widget (date and/or time picker) and a powerful date/time parse/format utility.
ATWidget
ATWidget is the AJAX-capable GUI component. Unlike most similar tools, nearly every field can be chosen with a single mouse click! And the wide variety of supported date and time specifiers make ATWidget a perfect fit where other interfaces won't work at all: variations such as time-only, prehistoric dates, foreign languages and unusual formats are all easy to support!
ATConverter
ATConverter converts between JavaScript String and Date objects. It supports most of MySQL's format specifiers, with a few powerful extensions! It can be used independently, or in conjunction with ATWidget. Here's an example of converting an ISO date/time string into a Date object and back again:

var conv = new ATConverter({format:"%Y-%m-%dT%H:%i:%s"});
var date = conv.parse("1990-01-06T15:00:00");
alert( conv.format(date) );
Single-Line Widget Configuration
ATWidget is attached to any input (text) field with a single line of JavaScript code. It can be placed as a popup (appearing when the user clicks the corresponding input field) or inline (always-present below the field). If used inline, the text field can be hidden so that only ATWidget is displayed. For example, the screenshot widget was created as follows:

<input type="text" id="demo" tabindex="100" />
<script type="text/javascript">
  new ATWidget("demo",{format:"%Y-%m-%d %h:%i",placement:"inline"});
  $("demo").hide();
</script>
Easy Customization
ATWidget only shows controls that are relevant to its format specifier. The appearance can be customized by modifying or supplementing the included CSS stylesheet. All labels, as well as month, weekday and era names and abbreviations, are also easy to change.
AJAX Validation
ATWidget can be configured to use AJAX to automatically submit changes to a server (which can approve or veto the selected value), simply by specifying the server URL during instantiation.
Accessibility and Degradation
The widget uses HTML anchors, with tabindex and title attributes, to maximize accessibility without a mouse. If JavaScript is disabled or unavailable, the text field remains a normal <input> that can be validated on the server.
Well-Documented
Visit the Any+Time™ web page for a tutorial and reference material. The uncompressed versions of the JS and CSS files are also heavily documented, to assist you in making changes.
Website:
Any+Time Date/Time Library: ATWidget Picker and ATConverter Parse/Format Utility
Author:
Andrew M. Andrews III
Size:
30 KB
Last modified:
06/04/2008
License:
CC BY-NC-SA (others negotiable)
Tags:
ajax, date & time, datepicker, form, select, validation
Rating:
0
(0/5 from 0 votes)
Your rating:
Please sign in or register to rate this script
Select multiple tags with Ctrl+click (Cmd+click on Mac)

Found a bug or have a suggestion?Let us know

bitsonnet corp · © 2007-2014 · all rights reserved

Sign In / Register / Forgot password