Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

mootools-datepicker #9

Open
wants to merge 300 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
300 commits
Select commit Hold shift + click to select a range
7f6211c
Date format stuff
Apr 15, 2010
b7fdde7
Use Date.parse instead of unformat
Apr 15, 2010
f25a974
Add Date.toObject/fromObject to the Date Type and remove them as methods
Apr 15, 2010
c832a4c
Fix Date.fromObject
Apr 15, 2010
0740a0d
Fix Date.fromObject better (it should extend instead of implement)
Apr 15, 2010
4ea473a
Store the date value in DatePicker:value and remove the unformat method
Apr 15, 2010
e179e4e
Some ($chk) cleanup
Apr 15, 2010
83110e0
Add a detach method
Apr 16, 2010
d9e40f1
Get rid of stupid $chk function
Apr 16, 2010
4bdbb3e
Combine the onFocus and show methods
Apr 16, 2010
cf12df2
Shorter events (.bind() instead of a closure)
Apr 16, 2010
c722831
Min/max dates for all dates
Apr 16, 2010
7be1583
Update Tests
Apr 16, 2010
a013ad0
No need for binding anymore
Apr 16, 2010
425efec
Fix min and max date
Apr 16, 2010
360ace9
Stop even for the toggler, make toggleElements deprecated and use opt…
Apr 16, 2010
524974b
Show the picker only if it is attached, and remove console.log
Apr 16, 2010
310533e
Remove format method, fixes for time format
Apr 16, 2010
2cdb075
Fix strange comma
Apr 16, 2010
9f92ebe
Fix dragger error in IE
Apr 16, 2010
b5b43e4
Remove formatMinMaxDate (only used once, so it will do in the initial…
Apr 16, 2010
19aeaa8
Fix toggle in IE
Apr 16, 2010
15494d1
Move close method since all the public methods are on the top
Apr 16, 2010
a9975aa
Do not call the close method twice for a toggle element
Apr 16, 2010
fc98a6f
Typo
Apr 16, 2010
098c955
Toggler can be a string
Apr 16, 2010
dedd9b5
Update readme
Apr 16, 2010
805ea46
Update Tests
Apr 16, 2010
5e5cac7
Finish README
Apr 16, 2010
9ef05bd
Create Link
Apr 16, 2010
d8fc065
be sure this.d is an instance of Date
Apr 17, 2010
642d423
Some extra notes
Apr 17, 2010
f2d4852
Forgot the ( and ) by instanceof
Apr 17, 2010
79bff29
Fix bug in the select method, it did not selected the date correctly
Apr 17, 2010
1d91c55
Add test
Apr 17, 2010
7feed81
Reactivate mousedown event to close the picker
Apr 17, 2010
2b06c0e
Add Drag.Move
Apr 17, 2010
724e5e9
Fix when date was 0 (jan)
Apr 17, 2010
2ecc0e7
Add a note
Apr 25, 2010
61a7467
Change current version to 1.50 beta 1
Apr 25, 2010
530e9bc
Add some readme text
Apr 25, 2010
8a136c8
Fix sometimes having to double click when opening a toggled datepicker.
May 3, 2010
06bd361
Fix hang when opening a datepicker for an input with an invalid date.
May 3, 2010
bf217ca
Add isValid method to the Date object and apply it as a replacement o…
May 3, 2010
9e622d5
Add semicolon
May 3, 2010
376048a
Remove the last $chk
May 3, 2010
24eacac
Shorter isValid method
May 3, 2010
cb23e93
Fix invalid dates slipping through.
May 3, 2010
d8abea4
Support manual input for a TimePicker.
May 3, 2010
08d9320
Convert spaces to tab.
May 3, 2010
0239ee3
Do not see the benefit of this, tab already works
May 3, 2010
3c4c2eb
Whitespace
May 4, 2010
04c3a48
Prevent the datepicker from being closed when you tab trough the inpu…
May 4, 2010
f3b067b
The provided timestamp and the min/max dates must be valid was well
May 4, 2010
758b8dd
Update package.yml
May 22, 2010
9ea4049
Fix head title in time select dialog
chemix Jul 7, 2010
c44bbec
Shortify an if-else and add a test-case for this configuration
Jul 7, 2010
e6ddd82
Update version
Jul 7, 2010
e9b50fb
Add translation for "Select a time", + fix spaces & CRLF
chemix Jul 14, 2010
45fb894
add support for change wheel time step
chemix Jul 14, 2010
b5dd4a3
Add some info about breaking changes
Jul 16, 2010
f691a69
Fix the toggleElements compatibility & a small optimalisation for the…
Jul 16, 2010
aa17253
Merge branch 'master' of [email protected]:arian/mootools-datepicker
Jul 16, 2010
74e0fdd
Merge branch 'master' of http://github.com/chemix/mootools-datepicker
Jul 16, 2010
5bbbe55
Some style changes and add Dutch translations
Jul 16, 2010
ccf70f9
More valid English
Jul 16, 2010
cfb6a87
removed remaining visual
marfillaster Jul 18, 2010
921cdc5
Merge branch 'develop'
marfillaster Jul 18, 2010
25b6c36
added default value to css only example with dutch localisation, to v…
thisconnect Sep 2, 2010
c5ca97a
Some minor changes mootools style spaces and some missing ;
thisconnect Sep 2, 2010
16279e4
possible fix for issue no.9
thisconnect Sep 2, 2010
a8de63f
some more minor spaces
thisconnect Sep 2, 2010
c94b78b
added z-index to datepicker.css
thisconnect Sep 3, 2010
c144845
applying fix for special chars in month names, see issue 8
thisconnect Sep 3, 2010
3028455
added Neurostep's date format for testing
thisconnect Sep 3, 2010
eba6c17
reverted previous fix for issue 9, and commit a new possible fix that…
thisconnect Sep 3, 2010
8ee5a08
fixed typo and added clone() as suggested by ccerrillo on issue 6
thisconnect Sep 4, 2010
f87b35b
fixed detach, issue 10
thisconnect Sep 5, 2010
dba031e
updated package.yml to work with packager-web
thisconnect Sep 5, 2010
c01c26e
updated dependecies in yaml header and package.yml to work with packa…
thisconnect Sep 5, 2010
2544f9c
Changed to MIT License, see issue http://github.com/arian/mootools-da…
thisconnect Sep 7, 2010
64bc818
Remove whitespace on newlines
Sep 15, 2010
0813a57
* Replace .bindWithEvent, because it will be removed in MooTools 1.3
Sep 15, 2010
bae164a
* Comment options that defaults to null.
Sep 15, 2010
c20d755
* Use Date:increment to include the maxDate day
Sep 15, 2010
8be337c
* Code cleanups
Sep 15, 2010
f678fa1
fix rounded minutes when timeWheelStep > 1
chemix Aug 13, 2010
c88aa41
better czech translation
chemix Aug 13, 2010
308c7ee
fix first select date, when use repeatly open and close (not select d…
chemix Aug 13, 2010
3108935
add input call event "onChange" when new value selected
chemix Aug 13, 2010
c4ab4d4
Fix #5 - The datepicker closed/flickered when another input element w…
Sep 20, 2010
833fc3d
Fixing behaviour when tabbing trough the input fields
Sep 20, 2010
9770ebf
Tagging 1.50 beta 5, all serious bugs are squashed
Sep 20, 2010
ed6ae50
Fix date change when the date and time pickers are used in combination
Sep 29, 2010
2840358
Add test for commit ed6ae502051891, fixes #17 and #20
Oct 8, 2010
4ac0281
Remove two unnecessary lines + add Chemix to the Authors
Oct 8, 2010
aaf555f
Add newline at the add of the package.yml file
Oct 16, 2010
155947d
Upgrade to Mootools 1.3 (dropping support for Mootools 1.2) using not…
seniorquico Oct 15, 2010
8d37fa5
Fix the maxDate setting by making it use the date currently being dra…
kevinweil Nov 4, 2010
49a9e4c
Optimize Element creation syntax with the CSS selector Element creation
Nov 4, 2010
e93d221
Updated the README a little + new version 1.60!
Nov 5, 2010
1096e95
Fixes #24 - The IFrame Shim for IE produced some error and did not fi…
Nov 5, 2010
486b044
New version 1.61 - Fixes some issues in IE
Nov 5, 2010
6491f3b
Update MooTools More and rename to mootools-core.js and mootools-more.js
Nov 7, 2010
dbf0c0b
First version of a Modular version. It is totally rewritten, though i…
Nov 7, 2010
7cebb11
No need for a new CSS file, the old one is 100% compatible!
Nov 7, 2010
6c6e12b
Remove inputs from the inputs property if they are detatched
Nov 7, 2010
5d4738c
Comment the default minDate, maxDate options in Picker.Date
Nov 7, 2010
40917b6
Fix where it should format as sortTime if the pickOnly option is `time`
Nov 8, 2010
43251e2
Only use input.retrieve when it is actually an element
Nov 8, 2010
d723ba9
Fix the input.retrieve correctly + swap the currentDate argument posi…
Nov 8, 2010
5df821b
Use Date:format for the Days Picker
Nov 8, 2010
a15b8c4
Use Date:format in the isLimited function for month comparison
Nov 8, 2010
2bed87f
Cleanup the Days classnames
Nov 8, 2010
8027cf9
Remove the pad function in favor of the Date:format method for the ti…
Nov 8, 2010
f5fd01f
Some small optimalizations in Picker
Nov 8, 2010
f52ae41
A small consistency change in the close method
Nov 8, 2010
2ab1775
Make IframeShim Optional
Nov 8, 2010
2e8ab03
Some other optimalizations in the initialize method of Picker
Nov 8, 2010
7ec28e0
Move the previous and next buttons from Picker.js to Picker.Date.js, …
Nov 8, 2010
7466a90
Move the index.html test to legacy.html to test compatibility with th…
Nov 8, 2010
22839da
The default date format was not selected correctly
Nov 8, 2010
48fa6fe
Add a classname to the slider div
Nov 8, 2010
73335d1
Add Localization Test
Nov 8, 2010
90d5ecc
Make sture when the timeWheelStep option is set, the minutes are alwa…
Nov 8, 2010
7367ef9
Add timepicker test
Nov 8, 2010
ce7d3fa
Add a MonthPicker Test
Nov 8, 2010
595844e
this.date should not be able to modify by one of the renderers + add …
Nov 8, 2010
73259b9
Better default dateformat option - only date if timepicker = false, d…
Nov 8, 2010
f0f3494
Never let the picker fall outside the screen, so the use does not hav…
Nov 8, 2010
4b659cb
Update package.yml and YAML headers a bit
Nov 8, 2010
d4b5b1e
Fix where the mouse pointer could disappear above the title
Nov 8, 2010
dfe5ee5
Fix the format correctly, if pickView = time
Nov 8, 2010
ebc4c41
Improve the Position method where Chrome sometimes failed to get the …
Nov 9, 2010
40a5cdc
Another improvement for Chrome, where it set the body height to 0px s…
Nov 9, 2010
d090756
Be sure the `canAlwaysGoUp` option will get an array, even when it is…
Nov 9, 2010
6353c15
Add a Intro page for the tests, that will show them in a IFrame + som…
Nov 9, 2010
eaccfee
Add a Min/Max Date Demo
Nov 9, 2010
c2d3a8f
Remove the maxlength option of the Submit button of the timePicker
Nov 9, 2010
be0c066
Hide the Picker element right away, to prevent flickering
Nov 9, 2010
0809972
Update the Test/Demos with a nice layout
Nov 9, 2010
6da5554
Update some Options in DatePicker
Nov 9, 2010
2af71d6
Update the README file with new Documentation
Nov 9, 2010
2fcaa05
Update package.yml a bit + Localization Docs in README.md
Nov 9, 2010
c70bb99
Add Russian Localization
Nov 10, 2010
2f190bf
Add top and bottom otions for the pickerPostion option
Nov 11, 2010
d30f489
Add Russian to the README
Nov 12, 2010
0d4fa36
Slightly better min/maxDate options
Nov 20, 2010
ffa50b3
Add the picker.position test to index.html
Nov 21, 2010
ef9c986
Final code bitching
Nov 21, 2010
3546199
Some minor Tests styling
Nov 21, 2010
ec3603e
Fix Screenshot image
Nov 21, 2010
8dea1bc
Add German language file thanks to Bastian Bringenberg!
Dec 20, 2010
68f8715
Add German language file to package.yml
Dec 20, 2010
fe1b805
Fixes #30 - It is now possible to set the day and month abbreviations…
Dec 20, 2010
a630139
Add an availableDates option and cleanup the limits detection a bit (…
Jan 11, 2011
8171a43
Add Italian Locale
Jan 11, 2011
6a68400
Fix right limit in the years-view + several variable renames
Jan 11, 2011
e878431
Update readme with license
Jan 15, 2011
bc7ec37
Add another test for an empty text input
Jan 30, 2011
639508a
Remove toggling with the inputs when togglers are set up.
Dec 2, 2010
d600ee1
Adding french translation
Dec 11, 2010
739cd6f
Update package to 2.0.1
Jan 31, 2011
04e4125
Only don't toggle when it has togglers
Feb 1, 2011
2440bef
Better example for theming and multiple css classes
Feb 1, 2011
3692418
Version 2.0.2!
Feb 1, 2011
96ce1f7
Add French language file to package.yml
Feb 1, 2011
5c2bcec
Fix input label in themes.html test
Feb 1, 2011
585da70
Update MooTools to 1.3.1
Mar 28, 2011
878d2dc
Date.Picker#select now updates inputs
arieh Apr 11, 2011
67af4e5
Update docs and test and some code enhancements for the select method
Apr 11, 2011
bacdbc1
Fix missing semicolon (thanks Tim!)
Apr 14, 2011
0b8db25
* Added Polish language file.
Apr 18, 2011
68727f8
Fixes #45 - Add an option for manually editing the input fields + som…
Apr 24, 2011
42c3b8f
Fix some double defined variables, unused code, a typo and some tests
Apr 24, 2011
1a442c3
And... 2.0.3!
Apr 24, 2011
e1fe6f7
2.0.4! Improved closing/toggling behavior, fixes #48
Jun 2, 2011
9a569c2
Multi Column DatePicker!
Jul 8, 2011
fd15f58
Prevent the Picker from fireing the onAttachedEvent twice when clicki…
Jul 8, 2011
ad32f13
Fix Close Button
Jul 8, 2011
843f64a
Add Possibility to add a footer
Jul 8, 2011
61ccc95
Split the renderers into the selected dates and the actual DOM operat…
Jul 8, 2011
716491b
Initial start for Picker.Date.Range
Jul 8, 2011
4e1b23d
Picker.Date.Range: Select all dates in the selected range by adding a…
Jul 11, 2011
c57fd92
Some fixes when you change the input field value or click on one date…
Jul 11, 2011
ef0dfd5
Fix Timepicker (some recent changes broke it :(
Jul 11, 2011
32d17d7
Add Test/range.html to the menu in index.html
Jul 11, 2011
6cec363
When the datepicker was closed by the closebutton, the field was stil…
Jul 12, 2011
46977f8
Make sure the right dates are rendered with with multiple input field…
Jul 12, 2011
5fa714c
Fire the attached event and rename it from "attachedEvent" to "attach…
Jul 12, 2011
42c77ac
Remove the setColumns tween argument, was too buggy and broke the tim…
Jul 12, 2011
81cda82
Make the _title options backward compatible or like it used to be
Jul 13, 2011
4d5cf2c
Some code cleanup:
Jul 13, 2011
95ab51c
Add Spanish translations (thanks juanparati)
Jul 14, 2011
6a4699e
Add an invertAvailable option that inverts the availableDates option …
Jul 14, 2011
fd966b6
Update MooTools to 1.3.2
Jul 14, 2011
dd8614a
Optimize images
realityking Jul 12, 2011
bbbecae
Add another example how you can use the range picker with an hidden i…
Jul 14, 2011
2c19805
Range: use the stored dates correctly
Jul 25, 2011
5cd7b6b
Always open the startView by default, fixes #53
Jul 25, 2011
19fbd66
Range: Change the `setStartEndDate` a bit so it does all the formatti…
Jul 25, 2011
47c6c5c
Update README
Jul 25, 2011
2b5d603
Fixes #58 - Fires the onchange event after a date is selected
Jul 25, 2011
311d9e0
Fixes #57 - Pass the input field as argument to the select event
Jul 25, 2011
1a5fa61
Testcase for #39 - could not reproduce
Jul 25, 2011
8eaaade
Testcase for #28, seems to be fixed. The » disappeared sometimes
Jul 25, 2011
a26a155
Improve accessiblity.
realityking Jul 18, 2011
7f76b92
Some cleanups for the aria changes
Jul 25, 2011
78c58dd
Fixes #7 - Add support for weeknumbers in the `days` view
Jul 25, 2011
510ca67
Fix weeknumbers test title
Jul 25, 2011
638de1e
Version bumb
Jul 25, 2011
b2ca29d
Accessibility improvement for the week number.
realityking Jul 28, 2011
b389c60
Add RTL support to the days view.
realityking Jul 28, 2011
2d2f4ab
Merge pull request #59 from realityking/aria
Jul 28, 2011
75f9093
Fix syntax error.
Jul 28, 2011
cfdcd30
Fixes #60 - French Typo
Jul 29, 2011
80411b2
Update FR language.
armandabric Jul 29, 2011
751ea2f
Add Portuguese translation
jonnsl Jul 29, 2011
e505587
Merge pull request #62 from Spy-Seth/patch-1
Jul 30, 2011
c5793e6
Merge pull request #63 from jonnsl/master
Jul 30, 2011
4efee6a
Add Brazil Portuguese to the supported languages
Jul 30, 2011
af178f1
newline
Jul 30, 2011
e7f494b
Add the togglesOnly option to Picker.Attach so when the toggle option…
Aug 18, 2011
a31a482
Fixes #68 - add missing comma in French Locale.
Aug 21, 2011
efbeea4
Added Hebrew locale
amitayh Sep 19, 2011
0271f31
Fixed unclickable dates bug
amitayh Sep 19, 2011
af2731e
Merge branch 'develop'
amitayh Sep 19, 2011
49597dd
Merge pull request #74 from amitayh/master
Sep 19, 2011
33c5954
Added Hebrew to the locale list in the readme file
amitayh Sep 20, 2011
07859a0
Merge pull request #75 from amitayh/master
Sep 21, 2011
ba3bedb
Fix some stylistic things (tabs → spaces, alphabetical locale list).
Sep 21, 2011
6597e9c
Update Tests to MooTools 1.4
Sep 21, 2011
0768c57
MooTools Datepicker 2.1.1!
Sep 21, 2011
f2621e5
Fixes #86 - Fix maxDate option when the minDate option was not used, …
Nov 6, 2011
d3a2309
Update to MooTools 1.4.1
Nov 15, 2011
f53f674
Fixes #84 - Picker hides after opening for the 2nd time
Nov 15, 2011
dca19cc
Add Afrikaans translations
rottekruid Dec 1, 2011
f4a7a13
Merge pull request #90 from listsm/master
Dec 1, 2011
1054b7c
Add Afrikaans to the supported languages in the readme.
Dec 1, 2011
cd3a084
added some missing spanish translations
ccerrillo Jan 17, 2012
c9017aa
romoved spaces
ccerrillo Jan 17, 2012
455adf1
Merge pull request #95 from ccerrillo/master
Jan 17, 2012
e0dfb76
Added Swedish translation
Dec 8, 2011
42917bd
Added Minimal theme
Dec 8, 2011
c4e179a
Made time choose button work in IE 9
leon Dec 20, 2011
46d166a
Add Swedish to the README
Jan 20, 2012
99bcd9d
Merge branch 'leon-master'
Jan 20, 2012
8051506
Added ukrainian locale file
Jun 30, 2012
e35fa19
Ukrainian locale mentioned in README
Jun 30, 2012
4e7e996
Merge pull request #117 from errno/master
arian Jun 30, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.tmp*
*~
379 changes: 379 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,379 @@
MooTools-DatePicker
===================

MooTools DatePicker is a nice modular and themable DatePicker. It has many features and options, such as
year, month, day or timepicker only modes, min and max dates, Localization and a lot more.

This Plugin makes use of MooTools' Locale and Date plugins in MooTools More, to provide a localized
datepicker, as well as easy formatting and parsing Dates.

This DatePicker is a fork of the original [MonkeyPhysics DatePicker](http://www.monkeyphysics.com/mootools/script/2/datepicker),
and has improved a lot since then. Though it should be (almost) backward compatible.

![Screenshot](https://github.com/arian/mootools-datepicker/raw/master/screenshot.png)

As of version 1.60 the datepicker will only work with MooTools 1.3.

How to use
----------

Below you will find a description and some docs how you can use the datepicker.
If you find any weird things, please create a ticket at github or fork and fix it!

The DatePicker consists out of three layers, a Picker class, which can be used to create any form of Picker, a Picker.Attach class,
which handles stuff like attaching the Picker to a input or anchor element. Finally there is the DatePicker class, which you'll probably
use. Every option of the Picker or Picker.Attach classes can be used in the DatePicker class.

Basic Example
-------------

First you need to include the following html tags:

#HTML
<script src="../Source/Locale.en-US.DatePicker.js" type="text/javascript"></script>
<script src="../Source/Picker.js" type="text/javascript"></script>
<script src="../Source/Picker.Attach.js" type="text/javascript"></script>
<script src="../Source/Picker.Date.js" type="text/javascript"></script>

<link href="../Source/datepicker_dashboard/datepicker_dashboard.css" rel="stylesheet">

Then you can simply use, for example:

#JS
new Picker.Date($$('input'), {
timePicker: true,
positionOffset: {x: 5, y: 0},
pickerClass: 'datepicker_dashboard',
useFadeInOut: !Browser.ie
});


### Theming:

Theming is done with CSS files, there are four themes available, which you can find in the Source folder.

Just include the CSS file and set the `pickerClass` option.


### Localization

The DatePicker uses the MooTools More Date Class, which already includes many localized strings.
For some specific strings DatePicker has its own localizations, which you can find in the Locale.__-__.DatePicker.js files.
Just include the file in your page with a script tag to use the translations.

Currently the following languages are supported

- af-ZA
- cs-CZ
- de-DE
- en-US
- es-ES
- fr-FR
- he-IL
- it-IT
- nl-NL
- pl-PL
- pt-BR
- ru-RU
- sv-SE
- uk-UA

You can set the current language with:

#JS
Locale.use('nl-NL');


Class: DatePicker
-----------------

### Syntax

#JS
var dp = new DatePicker([element, options]);

### Arguments

1. element: (*element*, *string*, *array*) The element(s) to attach the datepicker to
2. options: (*object*, optional) The options object

### Options:

All the options of the Picker and Picker.Attach classes, and:

- minDate: (*Date instance*, *string*, defaults to `null`) Minimum date allowed to pick. Blocks anything before.
- maxDate: (*Date instance*, *string*, defaults to `null`) Maximum date allowed to pick. Blocks anything after.
- availableDates: (*object*, defaults to `null`) When only a few dates should be selectable. An object like `{2011: {1: [19, 29, 31], 3: [5, 19, 24]}}` with all the dates (year -> months -> days).
- invertAvailable: (*boolean*, defaults to `false`) Invert the `availableDates` option.
- format: (*string*, defaults to the default localized format) The format to output into the input field. Uses [Date.format](http://mootools.net/docs/more/Types/Date#Date:format)
- timePicker: (*boolean*, defaults to 1 `false`) Enable/disable timepicker functionality. Hours/Minutes values can be changed using the scrollwheel.
- timeWheelStep: (*number*, defaults to `1`) The number of minutes the minutes field will change in the timepicker when using the scrollwheel, for example 5, 10, 15. The value will always be k * timeWheelStep.
- yearPicker: (*boolean*, defaults to `true`) Enable/disable yearpicker functionality. Makes it much easier to change years.
- yearPerPage: (*number*, defaults to `20`) Amount of years to show in the year-picking view. Be aware that this may affect your layout.
- startView: (*string*, defaults to `days`) The view that will be showed when the picker opens. The options are `time`, `days`, `months` and `years`
- openLastView: (*boolean*, defaults to `false`) Opens the last opened view after the picker is opened again, instead of the `startView`
- pickOnly: (*string*, defaults to `false`) If you just want to pick a year, month, day or time. The options are `time`, `days`, `months` and `years`
- canAlwaysGoUp: (*array*, defaults to `['months', 'days']`) The views where you can click the title to go up. The options are `time`, `days`, `months` and `years`
- updateAll (*boolean*, defaults to `false`) whether or not to update all inputs when selecting a date
- weeknumbers (*boolean*, defaults to `false`) display weeknumbers for the `days` view
- months_abbr: (*array*) An array with the month name abbreviations. If nothing is set, it will automatically use MooTools Locale to get the abbreviations
- days_abbr: (*array*) An array with the day name abbreviations. If nothing is set, it will automatically use MooTools Locale to get the abbreviations
- years_title: (*function*, defaults to a function which returns `year + '-' + (year + options.yearsPerPage - 1)`) A function that returns the title for the yearpicker with as arguments the date object and the options object.
- months_title: (*function*, defaults to a function which returns `date.format('%b %Y')`) A function that returns the title for the monthpicker with as arguments the date object and the options object.
- days_title: (*function*, defaults to a function which returns `date.format('%b %Y')`) A function that returns the title for the daypicker with as arguments the date object and the options object.
- time_title: (*function*, defaults to a function which returns `(options.pickOnly == 'time') ? Locale.get('DatePicker.select_a_time') : date.format('%d %B, %Y')`) A function that returns the title for the timepicker with as arguments the date object and the options object.



### Events:

- onSelect: Will fire when the user has selected a date

#### signature

#JS
onSelect(date)

#### arguments

1. date - A Date object. You could use [Date.format](http://mootools.net/docs/more/Types/Date#Date:format) to format it into a string. For example to set it into a hidden field which will be sent to the server.


### Examples

#JS
new DatePicker('inputField', {
timePicker: true,
pickerClass: 'datepicker_jqui',
onSelect: function(date){
myHiddenField.set('value', date.format('%s');
}
});

Picker.Date method: select
--------------------------

Selects a date manually.

### Syntax:

picker.select(date[, all]);

### Arguments:

1. date (*Date instance*) the date instance of the new date
2. all (*boolean*, optional) Whether it should update all inputs (defaults to the *updateAll* option)

### Returns:

- Picker.Date instance.


Class: Picker.Date.Range
------------------------

The range picker can be used to select date ranges, with a start date and a end date.

### Syntax:

#JS
var dp = new Picker.Date.Range([element, options]);

### Arguments:

#### Options:

All `Picker.Date` options plus:

- getStartEndDate: (*function*) Parses the two dates in the input field to `Date` instances. Signature: `function(input)`
- setStartEndDate: (*function*) Formats the dates and sets the input field value. Signature: `function(input, dates)`
- columns: (*number*, defaults to `3`) Number of columns
- footer: (*boolean*, defaults to `true`) Creates an extra footer element


Class: Picker.Attach
--------------------

Picker.Attach handles all the links from elements to the Picker. It handles the onfocus events of input elements etc.
The Class itself is not very useful on its own, but it is useful to extend this Class.
This class adds a outerclick as well to close the Picker if you click outside the picker.

#### Syntax:

#JS
new Picker.Attach(attachTo, options);

#### Options:

- toggle: (*element*, *string*, *array*) A collection of elements which will toggle the picker when such a link is clicked.
- togglesOnly: (*boolean, defaults to `true`) If the `toggle` option is set, this option determines if the focus/blur events on the input fields are still added as well.
- blockKeydown: (*boolean*, defaults to `true`) Whether it should block keydown events, so the user can type into the input field or not.

### Picker.Attach Method: attach

This will attach links and input elements to the picker

#### Syntax

#JS
myPicker.attach(attachTo);

#### Arguments

1. attachTo: (*element*, *string*, *array*) The elements or element to attach to the Picker. Can be a input element for onfocus events or other elements for click events.


### Picker.Attach Method: detach

This will detach links and input elements from the picker

#### Syntax

#JS
myPicker.detach(detach);

#### Arguments

1. detach: (*element*, *string*, *array*) The elements or element to detach from the Picker. Can be a input element for onfocus events or other elements for click events.


Class: Picker
-------------

This is a generic Picker Class, which is used for the basic things, like positioning, Fx, open, close, stuff like that.

#### Syntax:

#JS
new Picker(options);

#### Options:

- pickerClass: (*string*, defaults to `datepicker`) CSS class for the main datepicker container element. You can use multiple classes by separating them by a space, e.g. `class1 class2 class3`
- inject: (*element*, defaults to `document.body`) This is where the Picker element will be injected to.
- anitmationDuration: (*number*, defaults to `400`) Duration of the slide/fade animations in milliseconds.
- useFadeInOut: (*boolean*, defaults to `true`) Whether to fade-in/out the datepicker popup. You might want to set this to `false` in IE.
- positionOffset: (*object*, defaults to `{x: 0, y: 0}`) Allows you to tweak the position at which the datepicker appears, relative to the input element. Formatted as an object with x and y properties. Values can be negative.
- pickerPosition: (*string*, defaults to `bottom`) If the picker is positioned relative to an element, you can choose to position it top, bottom, left or right.
- draggable: (*boolean*, defaults to `true`) Will make the picker draggable, if Drag from MooTools More is included.
- columns: (*number*, defaults to `1`) Number of columns
- footer: (*boolean*, defaults to `false`) Creates an extra footer element

#### Events:

- open - triggered when the Picker will open (before the fx)
- close - triggered after the Picker is will get closed (before the fx)
- show - triggered when the Picker is shown
- hide - triggered when the Picker is hidden



### Picker Method: show

A method to show the Picker manually, with a Fx.

#### Syntax

#JS
dp.show()

### Picker Method: close

Closes the Picker with a Fx.

#### Syntax

#JS
dp.close();


### Picker Method: toggle

Toggles the Picker with a Fx.

#### Syntax

#JS
picker.toggle();

### Picker Method: show

Opens the Picker directly.

#### Syntax

#JS
dp.show();


### Picker Method: hide

Hides the Picker directly.

#### Syntax

#JS
dp.hide();


### Picker Method: destroy

Destroys the Picker

#JS
picker.destroy();


### Picker Method: position

Positions the Picker.

#### Syntax:

#JS
picker.position(x, y);
// or
picker.position(myElement, where);

#### Arguments

1. x: (*number*) Number of pixels from the left
2. y: (*number*) Number of pixels from the top

Or

1. myElement - (*element*) A element the Picker should be positioned relative to.
2. where - (*string*, optional) Position the Picker `left` or `right` to the element.


### Picker Method: setContent

Set the content of the Picker, either elements or text.

#### Syntax:

#JS
picker.setContent(element, fx);

#### Arguments:

1. element: (*element*, *string*) Set the content of the Picker with this value
2. fx: (*string*, optional) Set the content of the picker, and apply it with this Fx. Options: 'fade', 'right', 'left'


### Picker Method: setTitle

Sets the Picker title text.

#JS
picker.setTitle(text);

#### Arguments:

1. text: (*string*) The text which will be set into the title.


License
-------

- [MIT License](http://www.opensource.org/licenses/mit-license.php)
Loading