diff --git a/demo.css b/demo.css index 945c9c18..aee90211 100644 --- a/demo.css +++ b/demo.css @@ -50,6 +50,10 @@ input.datepicker--input__focused { border-color: #0089ec; } +input[type=submit] { + margin-top: 1em; + padding: 8px 20px; +} diff --git a/docs.htm b/docs.htm index 7962c394..2ee40bb0 100644 --- a/docs.htm +++ b/docs.htm @@ -40,9 +40,12 @@

All the options and default settings:

show_months_full: true, show_weekdays_short: true, -// Date format +// Displayed date format format: 'd mmmm, yyyy', +// Submitted date format +format_submit: 'yyyy-mm-dd', + // Disable picker disable_picker: false, @@ -182,12 +185,32 @@

Custom date formats

+
+ +
+
+

Custom submitted date formats

+ + +
+
+ +
$( '.datepicker' ).datepicker({
+    format_submit: 'dd-mm-yyyy'
+})
+ +

By default, the date picker will submit dates to the server in the format yyyy-mm-dd regardless of the format displayed to the user, as per the W3C's notes on date formats.

+ +

You can override the submitted format by setting format_submit to a string, following the same format rules as above. You can also disable on-submit reformatting entirely by setting format_submit to false. In this case, the value submitted to the server will match the displayed format.

+ +
+

Disable picker for native calendar

- +
$( '.datepicker' ).datepicker({
@@ -205,7 +228,7 @@ 

Disable picker for native calendar

Minimum and maximum date range

- +
$( '.datepicker' ).datepicker({
@@ -297,7 +320,7 @@ 

Minimum and maximum date range<

Themed calendar

Go crazy.

- +
.datepicker-themed {
@@ -386,15 +409,19 @@ 

Themed calendar

}) $( '#input_04' ).datepicker({ - disable_picker: true + format_submit: 'dd-mm-yyyy' }) $( '#input_05' ).datepicker({ + disable_picker: true + }) + + $( '#input_06' ).datepicker({ date_min: false, date_max: 5 }) - $( '#input_06' ).datepicker() + $( '#input_07' ).datepicker()