Skip to content

bojanpejic/jquery.autodate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Automatically expand a date input (1.0)
by Manuel Joao Silva (www.manueljoaosilva.com)
mail@manueljoaosilva.com

USAGE:
$("#foo").autodate();

EXAMPLES:
01 - expands to: {current year}-{current month}-01
0102 - expands to: {current year}-02-01
010212 - expands to: 2012-02-01
010251 - expands to: 1951-02-01
01022051 - expands to: 2051-02-01

note 1: if user only inputs two digits in year if it's less than 50 expands to the future,
        if it's more than 50 expands to the past.

note 2: non numerical chars are wiped, this means if a user inputs something like 02-01 that
        will exand to {current year}-01-02, because all the - are wiped first.


DEPENDENCIES: This script requires jQuery to work.  Download jQuery at http://jquery.com

DEMO: http://manueljoaosilva.com/jquery-autodate-demo/

-------------------------------------------------------------------------------------------

Copyright (C) 2011 by Manuel Joao Silva (http://manueljoaosilva.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

About

A jQuery plugin that mimics SAP date field behaviour.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published