From 29f8dfba4c6669cb954b060c908f16c948e1832c Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 2 Sep 2016 09:02:50 +0200 Subject: [PATCH] Update bootstrap-datepicker --- public/css/bootstrap-datepicker3.css | 315 ++---- public/js/bootstrap-datepicker.js | 894 +++++++++++------- .../bootstrap-datepicker.ar-tn.js | 15 + .../bootstrap-datepicker.ca.js | 1 + .../bootstrap-datepicker.cs.js | 1 + .../bootstrap-datepicker.da.js | 14 +- .../bootstrap-datepicker.de.js | 1 + .../bootstrap-datepicker.en-AU.js | 18 + .../bootstrap-datepicker.en-GB.js | 1 + .../bootstrap-datepicker.en-IE.js | 17 + .../bootstrap-datepicker.en-NZ.js | 17 + .../bootstrap-datepicker.en-ZA.js | 17 + .../bootstrap-datepicker.es.js | 1 + .../bootstrap-datepicker.fr-CH.js | 1 + .../bootstrap-datepicker.fr.js | 1 + .../bootstrap-datepicker.hy.js | 6 +- .../bootstrap-datepicker.it.js | 1 + .../bootstrap-datepicker.kh.js | 10 +- .../bootstrap-datepicker.kk.js | 2 +- .../bootstrap-datepicker.km.js | 15 + .../bootstrap-datepicker.ko.js | 2 +- .../bootstrap-datepicker.lt.js | 5 +- .../bootstrap-datepicker.nb.js | 3 +- .../bootstrap-datepicker.nl-BE.js | 1 + .../bootstrap-datepicker.nl.js | 1 + .../bootstrap-datepicker.pl.js | 14 +- .../bootstrap-datepicker.pt-BR.js | 1 + .../bootstrap-datepicker.pt.js | 1 + .../bootstrap-datepicker.rs-latin.js | 2 + .../bootstrap-datepicker.rs.js | 2 + .../bootstrap-datepicker.sk.js | 4 +- 31 files changed, 787 insertions(+), 597 deletions(-) create mode 100644 public/js/datepicker-locales/bootstrap-datepicker.ar-tn.js create mode 100644 public/js/datepicker-locales/bootstrap-datepicker.en-AU.js create mode 100644 public/js/datepicker-locales/bootstrap-datepicker.en-IE.js create mode 100644 public/js/datepicker-locales/bootstrap-datepicker.en-NZ.js create mode 100644 public/js/datepicker-locales/bootstrap-datepicker.en-ZA.js create mode 100644 public/js/datepicker-locales/bootstrap-datepicker.km.js diff --git a/public/css/bootstrap-datepicker3.css b/public/css/bootstrap-datepicker3.css index 1540d0b..bf9c8cf 100644 --- a/public/css/bootstrap-datepicker3.css +++ b/public/css/bootstrap-datepicker3.css @@ -1,5 +1,5 @@ /*! - * Datepicker for Bootstrap v1.5.0 (https://github.com/eternicode/bootstrap-datepicker) + * Datepicker for Bootstrap v1.6.4 (https://github.com/eternicode/bootstrap-datepicker) * * Copyright 2012 Stefan Petre * Improvements by Andrew Rowls @@ -38,7 +38,7 @@ display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; + border-bottom: 6px solid #fff; border-top: 0; position: absolute; } @@ -68,10 +68,7 @@ .datepicker-dropdown.datepicker-orient-top:after { bottom: -6px; border-bottom: 0; - border-top: 6px solid #ffffff; -} -.datepicker > div { - display: none; + border-top: 6px solid #fff; } .datepicker table { margin: 0; @@ -96,7 +93,7 @@ } .datepicker table tr td.old, .datepicker table tr td.new { - color: #999999; + color: #777777; } .datepicker table tr td.day:hover, .datepicker table tr td.focused { @@ -106,51 +103,42 @@ .datepicker table tr td.disabled, .datepicker table tr td.disabled:hover { background: none; - color: #999999; + color: #777777; cursor: default; } .datepicker table tr td.highlighted { - color: #000000; + color: #000; background-color: #d9edf7; border-color: #85c5e5; border-radius: 0; } .datepicker table tr td.highlighted:focus, .datepicker table tr td.highlighted.focus { - color: #000000; + color: #000; background-color: #afd9ee; border-color: #298fc2; } .datepicker table tr td.highlighted:hover { - color: #000000; + color: #000; background-color: #afd9ee; border-color: #52addb; } .datepicker table tr td.highlighted:active, -.datepicker table tr td.highlighted.active, -.open > .dropdown-toggle.datepicker table tr td.highlighted { - color: #000000; +.datepicker table tr td.highlighted.active { + color: #000; background-color: #afd9ee; border-color: #52addb; } .datepicker table tr td.highlighted:active:hover, .datepicker table tr td.highlighted.active:hover, -.open > .dropdown-toggle.datepicker table tr td.highlighted:hover, .datepicker table tr td.highlighted:active:focus, .datepicker table tr td.highlighted.active:focus, -.open > .dropdown-toggle.datepicker table tr td.highlighted:focus, .datepicker table tr td.highlighted:active.focus, -.datepicker table tr td.highlighted.active.focus, -.open > .dropdown-toggle.datepicker table tr td.highlighted.focus { - color: #000000; +.datepicker table tr td.highlighted.active.focus { + color: #000; background-color: #91cbe8; border-color: #298fc2; } -.datepicker table tr td.highlighted:active, -.datepicker table tr td.highlighted.active, -.open > .dropdown-toggle.datepicker table tr td.highlighted { - background-image: none; -} .datepicker table tr td.highlighted.disabled:hover, .datepicker table tr td.highlighted[disabled]:hover, fieldset[disabled] .datepicker table tr td.highlighted:hover, @@ -169,49 +157,40 @@ fieldset[disabled] .datepicker table tr td.highlighted.focus { .datepicker table tr td.highlighted.disabled, .datepicker table tr td.highlighted.disabled:active { background: #d9edf7; - color: #999999; + color: #777777; } .datepicker table tr td.today { - color: #000000; + color: #000; background-color: #ffdb99; border-color: #ffb733; } .datepicker table tr td.today:focus, .datepicker table tr td.today.focus { - color: #000000; + color: #000; background-color: #ffc966; border-color: #b37400; } .datepicker table tr td.today:hover { - color: #000000; + color: #000; background-color: #ffc966; border-color: #f59e00; } .datepicker table tr td.today:active, -.datepicker table tr td.today.active, -.open > .dropdown-toggle.datepicker table tr td.today { - color: #000000; +.datepicker table tr td.today.active { + color: #000; background-color: #ffc966; border-color: #f59e00; } .datepicker table tr td.today:active:hover, .datepicker table tr td.today.active:hover, -.open > .dropdown-toggle.datepicker table tr td.today:hover, .datepicker table tr td.today:active:focus, .datepicker table tr td.today.active:focus, -.open > .dropdown-toggle.datepicker table tr td.today:focus, .datepicker table tr td.today:active.focus, -.datepicker table tr td.today.active.focus, -.open > .dropdown-toggle.datepicker table tr td.today.focus { - color: #000000; +.datepicker table tr td.today.active.focus { + color: #000; background-color: #ffbc42; border-color: #b37400; } -.datepicker table tr td.today:active, -.datepicker table tr td.today.active, -.open > .dropdown-toggle.datepicker table tr td.today { - background-image: none; -} .datepicker table tr td.today.disabled:hover, .datepicker table tr td.today[disabled]:hover, fieldset[disabled] .datepicker table tr td.today:hover, @@ -230,50 +209,41 @@ fieldset[disabled] .datepicker table tr td.today.focus { .datepicker table tr td.today.disabled, .datepicker table tr td.today.disabled:active { background: #ffdb99; - color: #999999; + color: #777777; } .datepicker table tr td.range { - color: #000000; + color: #000; background-color: #eeeeee; border-color: #bbbbbb; border-radius: 0; } .datepicker table tr td.range:focus, .datepicker table tr td.range.focus { - color: #000000; + color: #000; background-color: #d5d5d5; border-color: #7c7c7c; } .datepicker table tr td.range:hover { - color: #000000; + color: #000; background-color: #d5d5d5; border-color: #9d9d9d; } .datepicker table tr td.range:active, -.datepicker table tr td.range.active, -.open > .dropdown-toggle.datepicker table tr td.range { - color: #000000; +.datepicker table tr td.range.active { + color: #000; background-color: #d5d5d5; border-color: #9d9d9d; } .datepicker table tr td.range:active:hover, .datepicker table tr td.range.active:hover, -.open > .dropdown-toggle.datepicker table tr td.range:hover, .datepicker table tr td.range:active:focus, .datepicker table tr td.range.active:focus, -.open > .dropdown-toggle.datepicker table tr td.range:focus, .datepicker table tr td.range:active.focus, -.datepicker table tr td.range.active.focus, -.open > .dropdown-toggle.datepicker table tr td.range.focus { - color: #000000; +.datepicker table tr td.range.active.focus { + color: #000; background-color: #c3c3c3; border-color: #7c7c7c; } -.datepicker table tr td.range:active, -.datepicker table tr td.range.active, -.open > .dropdown-toggle.datepicker table tr td.range { - background-image: none; -} .datepicker table tr td.range.disabled:hover, .datepicker table tr td.range[disabled]:hover, fieldset[disabled] .datepicker table tr td.range:hover, @@ -292,49 +262,40 @@ fieldset[disabled] .datepicker table tr td.range.focus { .datepicker table tr td.range.disabled, .datepicker table tr td.range.disabled:active { background: #eeeeee; - color: #999999; + color: #777777; } .datepicker table tr td.range.highlighted { - color: #000000; + color: #000; background-color: #e4eef3; border-color: #9dc1d3; } .datepicker table tr td.range.highlighted:focus, .datepicker table tr td.range.highlighted.focus { - color: #000000; + color: #000; background-color: #c1d7e3; border-color: #4b88a6; } .datepicker table tr td.range.highlighted:hover { - color: #000000; + color: #000; background-color: #c1d7e3; border-color: #73a6c0; } .datepicker table tr td.range.highlighted:active, -.datepicker table tr td.range.highlighted.active, -.open > .dropdown-toggle.datepicker table tr td.range.highlighted { - color: #000000; +.datepicker table tr td.range.highlighted.active { + color: #000; background-color: #c1d7e3; border-color: #73a6c0; } .datepicker table tr td.range.highlighted:active:hover, .datepicker table tr td.range.highlighted.active:hover, -.open > .dropdown-toggle.datepicker table tr td.range.highlighted:hover, .datepicker table tr td.range.highlighted:active:focus, .datepicker table tr td.range.highlighted.active:focus, -.open > .dropdown-toggle.datepicker table tr td.range.highlighted:focus, .datepicker table tr td.range.highlighted:active.focus, -.datepicker table tr td.range.highlighted.active.focus, -.open > .dropdown-toggle.datepicker table tr td.range.highlighted.focus { - color: #000000; +.datepicker table tr td.range.highlighted.active.focus { + color: #000; background-color: #a8c8d8; border-color: #4b88a6; } -.datepicker table tr td.range.highlighted:active, -.datepicker table tr td.range.highlighted.active, -.open > .dropdown-toggle.datepicker table tr td.range.highlighted { - background-image: none; -} .datepicker table tr td.range.highlighted.disabled:hover, .datepicker table tr td.range.highlighted[disabled]:hover, fieldset[disabled] .datepicker table tr td.range.highlighted:hover, @@ -353,49 +314,40 @@ fieldset[disabled] .datepicker table tr td.range.highlighted.focus { .datepicker table tr td.range.highlighted.disabled, .datepicker table tr td.range.highlighted.disabled:active { background: #e4eef3; - color: #999999; + color: #777777; } .datepicker table tr td.range.today { - color: #000000; + color: #000; background-color: #f7ca77; border-color: #f1a417; } .datepicker table tr td.range.today:focus, .datepicker table tr td.range.today.focus { - color: #000000; + color: #000; background-color: #f4b747; border-color: #815608; } .datepicker table tr td.range.today:hover { - color: #000000; + color: #000; background-color: #f4b747; border-color: #bf800c; } .datepicker table tr td.range.today:active, -.datepicker table tr td.range.today.active, -.open > .dropdown-toggle.datepicker table tr td.range.today { - color: #000000; +.datepicker table tr td.range.today.active { + color: #000; background-color: #f4b747; border-color: #bf800c; } .datepicker table tr td.range.today:active:hover, .datepicker table tr td.range.today.active:hover, -.open > .dropdown-toggle.datepicker table tr td.range.today:hover, .datepicker table tr td.range.today:active:focus, .datepicker table tr td.range.today.active:focus, -.open > .dropdown-toggle.datepicker table tr td.range.today:focus, .datepicker table tr td.range.today:active.focus, -.datepicker table tr td.range.today.active.focus, -.open > .dropdown-toggle.datepicker table tr td.range.today.focus { - color: #000000; +.datepicker table tr td.range.today.active.focus { + color: #000; background-color: #f2aa25; border-color: #815608; } -.datepicker table tr td.range.today:active, -.datepicker table tr td.range.today.active, -.open > .dropdown-toggle.datepicker table tr td.range.today { - background-image: none; -} .datepicker table tr td.range.today.disabled:hover, .datepicker table tr td.range.today[disabled]:hover, fieldset[disabled] .datepicker table tr td.range.today:hover, @@ -411,12 +363,12 @@ fieldset[disabled] .datepicker table tr td.range.today.focus { .datepicker table tr td.range.today.disabled, .datepicker table tr td.range.today.disabled:active { background: #f7ca77; - color: #999999; + color: #777777; } .datepicker table tr td.selected, .datepicker table tr td.selected.highlighted { - color: #ffffff; - background-color: #999999; + color: #fff; + background-color: #777777; border-color: #555555; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } @@ -424,56 +376,40 @@ fieldset[disabled] .datepicker table tr td.range.today.focus { .datepicker table tr td.selected.highlighted:focus, .datepicker table tr td.selected.focus, .datepicker table tr td.selected.highlighted.focus { - color: #ffffff; - background-color: #808080; + color: #fff; + background-color: #5e5e5e; border-color: #161616; } .datepicker table tr td.selected:hover, .datepicker table tr td.selected.highlighted:hover { - color: #ffffff; - background-color: #808080; + color: #fff; + background-color: #5e5e5e; border-color: #373737; } .datepicker table tr td.selected:active, .datepicker table tr td.selected.highlighted:active, .datepicker table tr td.selected.active, -.datepicker table tr td.selected.highlighted.active, -.open > .dropdown-toggle.datepicker table tr td.selected, -.open > .dropdown-toggle.datepicker table tr td.selected.highlighted { - color: #ffffff; - background-color: #808080; +.datepicker table tr td.selected.highlighted.active { + color: #fff; + background-color: #5e5e5e; border-color: #373737; } .datepicker table tr td.selected:active:hover, .datepicker table tr td.selected.highlighted:active:hover, .datepicker table tr td.selected.active:hover, .datepicker table tr td.selected.highlighted.active:hover, -.open > .dropdown-toggle.datepicker table tr td.selected:hover, -.open > .dropdown-toggle.datepicker table tr td.selected.highlighted:hover, .datepicker table tr td.selected:active:focus, .datepicker table tr td.selected.highlighted:active:focus, .datepicker table tr td.selected.active:focus, .datepicker table tr td.selected.highlighted.active:focus, -.open > .dropdown-toggle.datepicker table tr td.selected:focus, -.open > .dropdown-toggle.datepicker table tr td.selected.highlighted:focus, .datepicker table tr td.selected:active.focus, .datepicker table tr td.selected.highlighted:active.focus, .datepicker table tr td.selected.active.focus, -.datepicker table tr td.selected.highlighted.active.focus, -.open > .dropdown-toggle.datepicker table tr td.selected.focus, -.open > .dropdown-toggle.datepicker table tr td.selected.highlighted.focus { - color: #ffffff; - background-color: #6e6e6e; +.datepicker table tr td.selected.highlighted.active.focus { + color: #fff; + background-color: #4c4c4c; border-color: #161616; } -.datepicker table tr td.selected:active, -.datepicker table tr td.selected.highlighted:active, -.datepicker table tr td.selected.active, -.datepicker table tr td.selected.highlighted.active, -.open > .dropdown-toggle.datepicker table tr td.selected, -.open > .dropdown-toggle.datepicker table tr td.selected.highlighted { - background-image: none; -} .datepicker table tr td.selected.disabled:hover, .datepicker table tr td.selected.highlighted.disabled:hover, .datepicker table tr td.selected[disabled]:hover, @@ -492,69 +428,53 @@ fieldset[disabled] .datepicker table tr td.selected.highlighted:focus, .datepicker table tr td.selected.highlighted[disabled].focus, fieldset[disabled] .datepicker table tr td.selected.focus, fieldset[disabled] .datepicker table tr td.selected.highlighted.focus { - background-color: #999999; + background-color: #777777; border-color: #555555; } .datepicker table tr td.active, .datepicker table tr td.active.highlighted { - color: #ffffff; - background-color: #428bca; - border-color: #357ebd; + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker table tr td.active:focus, .datepicker table tr td.active.highlighted:focus, .datepicker table tr td.active.focus, .datepicker table tr td.active.highlighted.focus { - color: #ffffff; - background-color: #3071a9; - border-color: #193c5a; + color: #fff; + background-color: #286090; + border-color: #122b40; } .datepicker table tr td.active:hover, .datepicker table tr td.active.highlighted:hover { - color: #ffffff; - background-color: #3071a9; - border-color: #285e8e; + color: #fff; + background-color: #286090; + border-color: #204d74; } .datepicker table tr td.active:active, .datepicker table tr td.active.highlighted:active, .datepicker table tr td.active.active, -.datepicker table tr td.active.highlighted.active, -.open > .dropdown-toggle.datepicker table tr td.active, -.open > .dropdown-toggle.datepicker table tr td.active.highlighted { - color: #ffffff; - background-color: #3071a9; - border-color: #285e8e; +.datepicker table tr td.active.highlighted.active { + color: #fff; + background-color: #286090; + border-color: #204d74; } .datepicker table tr td.active:active:hover, .datepicker table tr td.active.highlighted:active:hover, .datepicker table tr td.active.active:hover, .datepicker table tr td.active.highlighted.active:hover, -.open > .dropdown-toggle.datepicker table tr td.active:hover, -.open > .dropdown-toggle.datepicker table tr td.active.highlighted:hover, .datepicker table tr td.active:active:focus, .datepicker table tr td.active.highlighted:active:focus, .datepicker table tr td.active.active:focus, .datepicker table tr td.active.highlighted.active:focus, -.open > .dropdown-toggle.datepicker table tr td.active:focus, -.open > .dropdown-toggle.datepicker table tr td.active.highlighted:focus, .datepicker table tr td.active:active.focus, .datepicker table tr td.active.highlighted:active.focus, .datepicker table tr td.active.active.focus, -.datepicker table tr td.active.highlighted.active.focus, -.open > .dropdown-toggle.datepicker table tr td.active.focus, -.open > .dropdown-toggle.datepicker table tr td.active.highlighted.focus { - color: #ffffff; - background-color: #285e8e; - border-color: #193c5a; -} -.datepicker table tr td.active:active, -.datepicker table tr td.active.highlighted:active, -.datepicker table tr td.active.active, -.datepicker table tr td.active.highlighted.active, -.open > .dropdown-toggle.datepicker table tr td.active, -.open > .dropdown-toggle.datepicker table tr td.active.highlighted { - background-image: none; +.datepicker table tr td.active.highlighted.active.focus { + color: #fff; + background-color: #204d74; + border-color: #122b40; } .datepicker table tr td.active.disabled:hover, .datepicker table tr td.active.highlighted.disabled:hover, @@ -574,8 +494,8 @@ fieldset[disabled] .datepicker table tr td.active.highlighted:focus, .datepicker table tr td.active.highlighted[disabled].focus, fieldset[disabled] .datepicker table tr td.active.focus, fieldset[disabled] .datepicker table tr td.active.highlighted.focus { - background-color: #428bca; - border-color: #357ebd; + background-color: #337ab7; + border-color: #2e6da4; } .datepicker table tr td span { display: block; @@ -587,22 +507,23 @@ fieldset[disabled] .datepicker table tr td.active.highlighted.focus { cursor: pointer; border-radius: 4px; } -.datepicker table tr td span:hover { +.datepicker table tr td span:hover, +.datepicker table tr td span.focused { background: #eeeeee; } .datepicker table tr td span.disabled, .datepicker table tr td span.disabled:hover { background: none; - color: #999999; + color: #777777; cursor: default; } .datepicker table tr td span.active, .datepicker table tr td span.active:hover, .datepicker table tr td span.active.disabled, .datepicker table tr td span.active.disabled:hover { - color: #ffffff; - background-color: #428bca; - border-color: #357ebd; + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker table tr td span.active:focus, @@ -613,17 +534,17 @@ fieldset[disabled] .datepicker table tr td.active.highlighted.focus { .datepicker table tr td span.active:hover.focus, .datepicker table tr td span.active.disabled.focus, .datepicker table tr td span.active.disabled:hover.focus { - color: #ffffff; - background-color: #3071a9; - border-color: #193c5a; + color: #fff; + background-color: #286090; + border-color: #122b40; } .datepicker table tr td span.active:hover, .datepicker table tr td span.active:hover:hover, .datepicker table tr td span.active.disabled:hover, .datepicker table tr td span.active.disabled:hover:hover { - color: #ffffff; - background-color: #3071a9; - border-color: #285e8e; + color: #fff; + background-color: #286090; + border-color: #204d74; } .datepicker table tr td span.active:active, .datepicker table tr td span.active:hover:active, @@ -632,14 +553,10 @@ fieldset[disabled] .datepicker table tr td.active.highlighted.focus { .datepicker table tr td span.active.active, .datepicker table tr td span.active:hover.active, .datepicker table tr td span.active.disabled.active, -.datepicker table tr td span.active.disabled:hover.active, -.open > .dropdown-toggle.datepicker table tr td span.active, -.open > .dropdown-toggle.datepicker table tr td span.active:hover, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled:hover { - color: #ffffff; - background-color: #3071a9; - border-color: #285e8e; +.datepicker table tr td span.active.disabled:hover.active { + color: #fff; + background-color: #286090; + border-color: #204d74; } .datepicker table tr td span.active:active:hover, .datepicker table tr td span.active:hover:active:hover, @@ -649,10 +566,6 @@ fieldset[disabled] .datepicker table tr td.active.highlighted.focus { .datepicker table tr td span.active:hover.active:hover, .datepicker table tr td span.active.disabled.active:hover, .datepicker table tr td span.active.disabled:hover.active:hover, -.open > .dropdown-toggle.datepicker table tr td span.active:hover, -.open > .dropdown-toggle.datepicker table tr td span.active:hover:hover, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled:hover, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled:hover:hover, .datepicker table tr td span.active:active:focus, .datepicker table tr td span.active:hover:active:focus, .datepicker table tr td span.active.disabled:active:focus, @@ -661,10 +574,6 @@ fieldset[disabled] .datepicker table tr td.active.highlighted.focus { .datepicker table tr td span.active:hover.active:focus, .datepicker table tr td span.active.disabled.active:focus, .datepicker table tr td span.active.disabled:hover.active:focus, -.open > .dropdown-toggle.datepicker table tr td span.active:focus, -.open > .dropdown-toggle.datepicker table tr td span.active:hover:focus, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled:focus, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled:hover:focus, .datepicker table tr td span.active:active.focus, .datepicker table tr td span.active:hover:active.focus, .datepicker table tr td span.active.disabled:active.focus, @@ -672,28 +581,10 @@ fieldset[disabled] .datepicker table tr td.active.highlighted.focus { .datepicker table tr td span.active.active.focus, .datepicker table tr td span.active:hover.active.focus, .datepicker table tr td span.active.disabled.active.focus, -.datepicker table tr td span.active.disabled:hover.active.focus, -.open > .dropdown-toggle.datepicker table tr td span.active.focus, -.open > .dropdown-toggle.datepicker table tr td span.active:hover.focus, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled.focus, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled:hover.focus { - color: #ffffff; - background-color: #285e8e; - border-color: #193c5a; -} -.datepicker table tr td span.active:active, -.datepicker table tr td span.active:hover:active, -.datepicker table tr td span.active.disabled:active, -.datepicker table tr td span.active.disabled:hover:active, -.datepicker table tr td span.active.active, -.datepicker table tr td span.active:hover.active, -.datepicker table tr td span.active.disabled.active, -.datepicker table tr td span.active.disabled:hover.active, -.open > .dropdown-toggle.datepicker table tr td span.active, -.open > .dropdown-toggle.datepicker table tr td span.active:hover, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled, -.open > .dropdown-toggle.datepicker table tr td span.active.disabled:hover { - background-image: none; +.datepicker table tr td span.active.disabled:hover.active.focus { + color: #fff; + background-color: #204d74; + border-color: #122b40; } .datepicker table tr td span.active.disabled:hover, .datepicker table tr td span.active:hover.disabled:hover, @@ -731,12 +622,12 @@ fieldset[disabled] .datepicker table tr td span.active.focus, fieldset[disabled] .datepicker table tr td span.active:hover.focus, fieldset[disabled] .datepicker table tr td span.active.disabled.focus, fieldset[disabled] .datepicker table tr td span.active.disabled:hover.focus { - background-color: #428bca; - border-color: #357ebd; + background-color: #337ab7; + border-color: #2e6da4; } .datepicker table tr td span.old, .datepicker table tr td span.new { - color: #999999; + color: #777777; } .datepicker .datepicker-switch { width: 145px; @@ -778,14 +669,10 @@ fieldset[disabled] .datepicker table tr td span.active.disabled:hover.focus { width: auto; min-width: 16px; padding: 4px 5px; - font-weight: normal; line-height: 1.42857143; - text-align: center; text-shadow: 0 1px 0 #fff; - vertical-align: middle; - background-color: #eeeeee; - border: solid #cccccc; border-width: 1px 0; margin-left: -5px; margin-right: -5px; } +/*# sourceMappingURL=bootstrap-datepicker3.css.map */ \ No newline at end of file diff --git a/public/js/bootstrap-datepicker.js b/public/js/bootstrap-datepicker.js index 11fedaf..76a99fc 100644 --- a/public/js/bootstrap-datepicker.js +++ b/public/js/bootstrap-datepicker.js @@ -1,5 +1,5 @@ /*! - * Datepicker for Bootstrap v1.5.0 (https://github.com/eternicode/bootstrap-datepicker) + * Datepicker for Bootstrap v1.6.4 (https://github.com/eternicode/bootstrap-datepicker) * * Copyright 2012 Stefan Petre * Improvements by Andrew Rowls @@ -84,6 +84,7 @@ // Picker object var Datepicker = function(element, options){ + $(element).data('datepicker', this); this._process_options(options); this.dates = new DateArray(); @@ -91,14 +92,24 @@ this.focusDate = null; this.element = $(element); - this.isInline = false; this.isInput = this.element.is('input'); + this.inputField = this.isInput ? this.element : this.element.find('input'); this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .btn') : false; - this.hasInput = this.component && this.element.find('input').length; + this.hasInput = this.component && this.inputField.length; if (this.component && this.component.length === 0) this.component = false; + this.isInline = !this.component && this.element.is('div'); this.picker = $(DPGlobal.template); + + // Checking templates and inserting + if (this._check_template(this.o.templates.leftArrow)) { + this.picker.find('.prev').html(this.o.templates.leftArrow); + } + if (this._check_template(this.o.templates.rightArrow)) { + this.picker.find('.next').html(this.o.templates.rightArrow); + } + this._buildEvents(); this._attachEvents(); @@ -116,7 +127,7 @@ this.viewMode = this.o.startView; if (this.o.calendarWeeks) - this.picker.find('tfoot .today, tfoot .clear') + this.picker.find('thead .datepicker-title, tfoot .today, tfoot .clear') .attr('colspan', function(i, val){ return parseInt(val) + 1; }); @@ -145,6 +156,44 @@ Datepicker.prototype = { constructor: Datepicker, + _resolveViewName: function(view, default_value){ + if (view === 0 || view === 'days' || view === 'month') { + return 0; + } + if (view === 1 || view === 'months' || view === 'year') { + return 1; + } + if (view === 2 || view === 'years' || view === 'decade') { + return 2; + } + if (view === 3 || view === 'decades' || view === 'century') { + return 3; + } + if (view === 4 || view === 'centuries' || view === 'millennium') { + return 4; + } + return default_value === undefined ? false : default_value; + }, + + _check_template: function(tmp){ + try { + // If empty + if (tmp === undefined || tmp === "") { + return false; + } + // If no html, everything ok + if ((tmp.match(/[<>]/g) || []).length <= 0) { + return true; + } + // Checking if html is fine + var jDom = $(tmp); + return jDom.length > 0; + } + catch (ex) { + return false; + } + }, + _process_options: function(opts){ // Store raw options for reference this._o = $.extend({}, this._o, opts); @@ -161,45 +210,12 @@ } o.language = lang; - switch (o.startView){ - case 2: - case 'decade': - o.startView = 2; - break; - case 1: - case 'year': - o.startView = 1; - break; - default: - o.startView = 0; - } - - switch (o.minViewMode){ - case 1: - case 'months': - o.minViewMode = 1; - break; - case 2: - case 'years': - o.minViewMode = 2; - break; - default: - o.minViewMode = 0; - } - - switch (o.maxViewMode) { - case 0: - case 'days': - o.maxViewMode = 0; - break; - case 1: - case 'months': - o.maxViewMode = 1; - break; - default: - o.maxViewMode = 2; - } + // Retrieve view index from any aliases + o.startView = this._resolveViewName(o.startView, 0); + o.minViewMode = this._resolveViewName(o.minViewMode, 0); + o.maxViewMode = this._resolveViewName(o.maxViewMode, 4); + // Check that the start view is between min and max o.startView = Math.min(o.startView, o.maxViewMode); o.startView = Math.max(o.startView, o.minViewMode); @@ -212,7 +228,7 @@ o.multidateSeparator = String(o.multidateSeparator); o.weekStart %= 7; - o.weekEnd = ((o.weekStart + 6) % 7); + o.weekEnd = (o.weekStart + 6) % 7; var format = DPGlobal.parseFormat(o.format); if (o.startDate !== -Infinity){ @@ -220,7 +236,7 @@ if (o.startDate instanceof Date) o.startDate = this._local_to_utc(this._zero_time(o.startDate)); else - o.startDate = DPGlobal.parseDate(o.startDate, format, o.language); + o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear); } else { o.startDate = -Infinity; @@ -231,7 +247,7 @@ if (o.endDate instanceof Date) o.endDate = this._local_to_utc(this._zero_time(o.endDate)); else - o.endDate = DPGlobal.parseDate(o.endDate, format, o.language); + o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear); } else { o.endDate = Infinity; @@ -254,12 +270,12 @@ o.datesDisabled = o.datesDisabled||[]; if (!$.isArray(o.datesDisabled)) { - var datesDisabled = []; - datesDisabled.push(DPGlobal.parseDate(o.datesDisabled, format, o.language)); - o.datesDisabled = datesDisabled; + o.datesDisabled = [ + o.datesDisabled + ]; } o.datesDisabled = $.map(o.datesDisabled,function(d){ - return DPGlobal.parseDate(d, format, o.language); + return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear); }); var plc = String(o.orientation).toLowerCase().split(/\s+/g), @@ -301,8 +317,6 @@ } else { o.defaultViewDate = UTCToday(); } - o.showOnFocus = o.showOnFocus !== undefined ? o.showOnFocus : true; - o.zIndexOffset = o.zIndexOffset !== undefined ? o.zIndexOffset : 10; }, _events: [], _secondaryEvents: [], @@ -356,19 +370,17 @@ else if (this.component && this.hasInput) { // component: input + button this._events = [ // For components that are not readonly, allow keyboard nav - [this.element.find('input'), events], + [this.inputField, events], [this.component, { click: $.proxy(this.show, this) }] ]; } - else if (this.element.is('div')){ // inline datepicker - this.isInline = true; - } else { this._events = [ [this.element, { - click: $.proxy(this.show, this) + click: $.proxy(this.show, this), + keydown: $.proxy(this.keydown, this) }] ]; } @@ -411,7 +423,7 @@ this.element.find(e.target).length || this.picker.is(e.target) || this.picker.find(e.target).length || - this.picker.hasClass('datepicker-inline') + this.isInline )){ this.hide(); } @@ -458,7 +470,7 @@ }, show: function(){ - if (this.element.attr('readonly') && this.o.enableOnReadonly === false) + if (this.inputField.prop('disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false)) return; if (!this.isInline) this.picker.appendTo(this.o.container); @@ -473,9 +485,7 @@ }, hide: function(){ - if (this.isInline) - return this; - if (!this.picker.is(':visible')) + if (this.isInline || !this.picker.is(':visible')) return this; this.focusDate = null; this.picker.hide().detach(); @@ -483,19 +493,13 @@ this.viewMode = this.o.startView; this.showMode(); - if ( - this.o.forceParse && - ( - this.isInput && this.element.val() || - this.hasInput && this.element.find('input').val() - ) - ) + if (this.o.forceParse && this.inputField.val()) this.setValue(); this._trigger('hide'); return this; }, - remove: function(){ + destroy: function(){ this.hide(); this._detachEvents(); this._detachSecondaryEvents(); @@ -561,15 +565,8 @@ }, clearDates: function(){ - var element; - if (this.isInput) { - element = this.element; - } else if (this.component) { - element = this.element.find('input'); - } - - if (element) { - element.val(''); + if (this.inputField) { + this.inputField.val(''); } this.update(); @@ -597,17 +594,11 @@ setDate: alias('setDates'), setUTCDate: alias('setUTCDates'), + remove: alias('destroy'), setValue: function(){ var formatted = this.getFormattedDate(); - if (!this.isInput){ - if (this.component){ - this.element.find('input').val(formatted); - } - } - else { - this.element.val(formatted); - } + this.inputField.val(formatted); return this; }, @@ -621,6 +612,10 @@ }).join(this.o.multidateSeparator); }, + getStartDate: function(){ + return this.o.startDate; + }, + setStartDate: function(startDate){ this._process_options({startDate: startDate}); this.update(); @@ -628,6 +623,10 @@ return this; }, + getEndDate: function(){ + return this.o.endDate; + }, + setEndDate: function(endDate){ this._process_options({endDate: endDate}); this.update(); @@ -662,7 +661,7 @@ visualPadding = 10, container = $(this.o.container), windowWidth = container.width(), - scrollTop = container.scrollTop(), + scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(), appendOffset = container.offset(); var parentsZindex = []; @@ -677,6 +676,10 @@ var left = offset.left - appendOffset.left, top = offset.top - appendOffset.top; + if (this.o.container !== 'body') { + top += scrollTop; + } + this.picker.removeClass( 'datepicker-orient-top datepicker-orient-bottom '+ 'datepicker-orient-right datepicker-orient-left' @@ -697,7 +700,7 @@ } else if (left + calendarWidth > windowWidth) { // the calendar passes the widow right edge. Align it to component right side this.picker.addClass('datepicker-orient-right'); - left = offset.left + width - calendarWidth; + left += width - calendarWidth; } else { // Default to left this.picker.addClass('datepicker-orient-left'); @@ -755,7 +758,7 @@ else { dates = this.isInput ? this.element.val() - : this.element.data('date') || this.element.find('input').val(); + : this.element.data('date') || this.inputField.val(); if (dates && this.o.multidate) dates = dates.split(this.o.multidateSeparator); else @@ -764,12 +767,11 @@ } dates = $.map(dates, $.proxy(function(date){ - return DPGlobal.parseDate(date, this.o.format, this.o.language); + return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear); }, this)); dates = $.grep(dates, $.proxy(function(date){ return ( - date < this.o.startDate || - date > this.o.endDate || + !this.dateWithinRange(date) || !date ); }, this), true); @@ -812,17 +814,22 @@ html += ' '; } while (dowCnt < this.o.weekStart + 7){ - html += ''+dates[this.o.language].daysMin[(dowCnt++)%7]+''; + html += ''+dates[this.o.language].daysMin[(dowCnt++)%7]+''; } html += ''; this.picker.find('.datepicker-days thead').append(html); }, fillMonths: function(){ + var localDate = this._utc_to_local(this.viewDate); var html = '', i = 0; while (i < 12){ - html += ''+dates[this.o.language].monthsShort[i++]+''; + var focused = localDate && localDate.getMonth() === i ? ' focused' : ''; + html += '' + dates[this.o.language].monthsShort[i++]+''; } this.picker.find('.datepicker-months td').html(html); }, @@ -859,18 +866,15 @@ } if (this.dates.contains(date) !== -1) cls.push('active'); - if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate || - $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1){ + if (!this.dateWithinRange(date)){ cls.push('disabled'); } + if (this.dateIsDisabled(date)){ + cls.push('disabled', 'disabled-date'); + } if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){ cls.push('highlighted'); } - if (this.o.datesDisabled.length > 0 && - $.grep(this.o.datesDisabled, function(d){ - return isUTCEquals(date, d); }).length > 0) { - cls.push('disabled', 'disabled-date'); - } if (this.range){ if (date > this.range[0] && date < this.range[this.range.length-1]){ @@ -889,6 +893,66 @@ return cls; }, + _fill_yearsView: function(selector, cssClass, factor, step, currentYear, startYear, endYear, callback){ + var html, view, year, steps, startStep, endStep, thisYear, i, classes, tooltip, before; + + html = ''; + view = this.picker.find(selector); + year = parseInt(currentYear / factor, 10) * factor; + startStep = parseInt(startYear / step, 10) * step; + endStep = parseInt(endYear / step, 10) * step; + steps = $.map(this.dates, function(d){ + return parseInt(d.getUTCFullYear() / step, 10) * step; + }); + + view.find('.datepicker-switch').text(year + '-' + (year + step * 9)); + + thisYear = year - step; + for (i = -1; i < 11; i += 1) { + classes = [cssClass]; + tooltip = null; + + if (i === -1) { + classes.push('old'); + } else if (i === 10) { + classes.push('new'); + } + if ($.inArray(thisYear, steps) !== -1) { + classes.push('active'); + } + if (thisYear < startStep || thisYear > endStep) { + classes.push('disabled'); + } + if (thisYear === this.viewDate.getFullYear()) { + classes.push('focused'); + } + + if (callback !== $.noop) { + before = callback(new Date(thisYear, 0, 1)); + if (before === undefined) { + before = {}; + } else if (typeof(before) === 'boolean') { + before = {enabled: before}; + } else if (typeof(before) === 'string') { + before = {classes: before}; + } + if (before.enabled === false) { + classes.push('disabled'); + } + if (before.classes) { + classes = classes.concat(before.classes.split(/\s+/)); + } + if (before.tooltip) { + tooltip = before.tooltip; + } + } + + html += '' + thisYear + ''; + thisYear += step; + } + view.find('td').html(html); + }, + fill: function(){ var d = new Date(this.viewDate), year = d.getUTCFullYear(), @@ -900,11 +964,12 @@ todaytxt = dates[this.o.language].today || dates['en'].today || '', cleartxt = dates[this.o.language].clear || dates['en'].clear || '', titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat, - tooltip; + tooltip, + before; if (isNaN(year) || isNaN(month)) return; - this.picker.find('.datepicker-days thead .datepicker-switch') - .text(DPGlobal.formatDate(new UTCDate(year, month), titleFormat, this.o.language)); + this.picker.find('.datepicker-days .datepicker-switch') + .text(DPGlobal.formatDate(d, titleFormat, this.o.language)); this.picker.find('tfoot .today') .text(todaytxt) .toggle(this.o.todayBtn !== false); @@ -944,14 +1009,13 @@ // Calendar week: ms between thursdays, div ms per day, div 7 days calWeek = (th - yth) / 864e5 / 7 + 1; html.push(''+ calWeek +''); - } } clsName = this.getClassNames(prevMonth); clsName.push('day'); if (this.o.beforeShowDay !== $.noop){ - var before = this.o.beforeShowDay(this._utc_to_local(prevMonth)); + before = this.o.beforeShowDay(this._utc_to_local(prevMonth)); if (before === undefined) before = {}; else if (typeof(before) === 'boolean') @@ -966,7 +1030,14 @@ tooltip = before.tooltip; } - clsName = $.unique(clsName); + //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2) + //Fallback to unique function for older jquery versions + if ($.isFunction($.uniqueSort)) { + clsName = $.uniqueSort(clsName); + } else { + clsName = $.unique(clsName); + } + html.push(''+prevMonth.getUTCDate() + ''); tooltip = null; if (prevMonth.getUTCDay() === this.o.weekEnd){ @@ -976,9 +1047,10 @@ } this.picker.find('.datepicker-days tbody').empty().append(html.join('')); + var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months'; var months = this.picker.find('.datepicker-months') .find('.datepicker-switch') - .text(this.o.maxViewMode < 2 ? 'Months' : year) + .text(this.o.maxViewMode < 2 ? monthsTitle : year) .end() .find('span').removeClass('active'); @@ -1000,60 +1072,58 @@ if (this.o.beforeShowMonth !== $.noop){ var that = this; $.each(months, function(i, month){ - if (!$(month).hasClass('disabled')) { - var moDate = new Date(year, i, 1); - var before = that.o.beforeShowMonth(moDate); - if (before === false) - $(month).addClass('disabled'); - } + var moDate = new Date(year, i, 1); + var before = that.o.beforeShowMonth(moDate); + if (before === undefined) + before = {}; + else if (typeof(before) === 'boolean') + before = {enabled: before}; + else if (typeof(before) === 'string') + before = {classes: before}; + if (before.enabled === false && !$(month).hasClass('disabled')) + $(month).addClass('disabled'); + if (before.classes) + $(month).addClass(before.classes); + if (before.tooltip) + $(month).prop('title', before.tooltip); }); } - html = ''; - year = parseInt(year/10, 10) * 10; - var yearCont = this.picker.find('.datepicker-years') - .find('.datepicker-switch') - .text(year + '-' + (year + 9)) - .end() - .find('td'); - year -= 1; - var years = $.map(this.dates, function(d){ - return d.getUTCFullYear(); - }), - classes; - for (var i = -1; i < 11; i++){ - classes = ['year']; - tooltip = null; + // Generating decade/years picker + this._fill_yearsView( + '.datepicker-years', + 'year', + 10, + 1, + year, + startYear, + endYear, + this.o.beforeShowYear + ); - if (i === -1) - classes.push('old'); - else if (i === 10) - classes.push('new'); - if ($.inArray(year, years) !== -1) - classes.push('active'); - if (year < startYear || year > endYear) - classes.push('disabled'); + // Generating century/decades picker + this._fill_yearsView( + '.datepicker-decades', + 'decade', + 100, + 10, + year, + startYear, + endYear, + this.o.beforeShowDecade + ); - if (this.o.beforeShowYear !== $.noop) { - var yrBefore = this.o.beforeShowYear(new Date(year, 0, 1)); - if (yrBefore === undefined) - yrBefore = {}; - else if (typeof(yrBefore) === 'boolean') - yrBefore = {enabled: yrBefore}; - else if (typeof(yrBefore) === 'string') - yrBefore = {classes: yrBefore}; - if (yrBefore.enabled === false) - classes.push('disabled'); - if (yrBefore.classes) - classes = classes.concat(yrBefore.classes.split(/\s+/)); - if (yrBefore.tooltip) - tooltip = yrBefore.tooltip; - } - - html += '' + year + ''; - year += 1; - } - yearCont.html(html); + // Generating millennium/centuries picker + this._fill_yearsView( + '.datepicker-centuries', + 'century', + 1000, + 100, + year, + startYear, + endYear, + this.o.beforeShowCentury + ); }, updateNavArrows: function(){ @@ -1080,6 +1150,8 @@ break; case 1: case 2: + case 3: + case 4: if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() || this.o.maxViewMode < 2){ this.picker.find('.prev').css({visibility: 'hidden'}); } @@ -1099,103 +1171,135 @@ click: function(e){ e.preventDefault(); e.stopPropagation(); - var target = $(e.target).closest('span, td, th'), - year, month, day; - if (target.length === 1){ - switch (target[0].nodeName.toLowerCase()){ - case 'th': - switch (target[0].className){ - case 'datepicker-switch': - this.showMode(1); - break; - case 'prev': - case 'next': - var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1); - switch (this.viewMode){ - case 0: - this.viewDate = this.moveMonth(this.viewDate, dir); - this._trigger('changeMonth', this.viewDate); - break; - case 1: - case 2: - this.viewDate = this.moveYear(this.viewDate, dir); - if (this.viewMode === 1) - this._trigger('changeYear', this.viewDate); - break; - } - this.fill(); - break; - case 'today': - var date = new Date(); - date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); - this.showMode(-2); - var which = this.o.todayBtn === 'linked' ? null : 'view'; - this._setDate(date, which); - break; - case 'clear': - this.clearDates(); - break; - } - break; - case 'span': - if (!target.hasClass('disabled')){ - this.viewDate.setUTCDate(1); - if (target.hasClass('month')){ - day = 1; - month = target.parent().find('span').index(target); - year = this.viewDate.getUTCFullYear(); - this.viewDate.setUTCMonth(month); - this._trigger('changeMonth', this.viewDate); - if (this.o.minViewMode === 1){ - this._setDate(UTCDate(year, month, day)); - this.showMode(); - } else { - this.showMode(-1); - } - } - else { - day = 1; - month = 0; - year = parseInt(target.text(), 10)||0; - this.viewDate.setUTCFullYear(year); - this._trigger('changeYear', this.viewDate); - if (this.o.minViewMode === 2){ - this._setDate(UTCDate(year, month, day)); - } - this.showMode(-1); - } - this.fill(); - } - break; - case 'td': - if (target.hasClass('day') && !target.hasClass('disabled')){ - day = parseInt(target.text(), 10)||1; - year = this.viewDate.getUTCFullYear(); - month = this.viewDate.getUTCMonth(); - if (target.hasClass('old')){ - if (month === 0){ - month = 11; - year -= 1; - } - else { - month -= 1; - } - } - else if (target.hasClass('new')){ - if (month === 11){ - month = 0; - year += 1; - } - else { - month += 1; - } - } + var target, dir, day, year, month, monthChanged, yearChanged; + target = $(e.target); + + // Clicked on the switch + if (target.hasClass('datepicker-switch')){ + this.showMode(1); + } + + // Clicked on prev or next + var navArrow = target.closest('.prev, .next'); + if (navArrow.length > 0) { + dir = DPGlobal.modes[this.viewMode].navStep * (navArrow.hasClass('prev') ? -1 : 1); + if (this.viewMode === 0){ + this.viewDate = this.moveMonth(this.viewDate, dir); + this._trigger('changeMonth', this.viewDate); + } else { + this.viewDate = this.moveYear(this.viewDate, dir); + if (this.viewMode === 1){ + this._trigger('changeYear', this.viewDate); + } + } + this.fill(); + } + + // Clicked on today button + if (target.hasClass('today') && !target.hasClass('day')){ + this.showMode(-2); + this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view'); + } + + // Clicked on clear button + if (target.hasClass('clear')){ + this.clearDates(); + } + + if (!target.hasClass('disabled')){ + // Clicked on a day + if (target.hasClass('day')){ + day = parseInt(target.text(), 10) || 1; + year = this.viewDate.getUTCFullYear(); + month = this.viewDate.getUTCMonth(); + + // From last month + if (target.hasClass('old')){ + if (month === 0) { + month = 11; + year = year - 1; + monthChanged = true; + yearChanged = true; + } else { + month = month - 1; + monthChanged = true; + } + } + + // From next month + if (target.hasClass('new')) { + if (month === 11){ + month = 0; + year = year + 1; + monthChanged = true; + yearChanged = true; + } else { + month = month + 1; + monthChanged = true; + } + } + this._setDate(UTCDate(year, month, day)); + if (yearChanged) { + this._trigger('changeYear', this.viewDate); + } + if (monthChanged) { + this._trigger('changeMonth', this.viewDate); + } + } + + // Clicked on a month + if (target.hasClass('month')) { + this.viewDate.setUTCDate(1); + day = 1; + month = target.parent().find('span').index(target); + year = this.viewDate.getUTCFullYear(); + this.viewDate.setUTCMonth(month); + this._trigger('changeMonth', this.viewDate); + if (this.o.minViewMode === 1){ + this._setDate(UTCDate(year, month, day)); + this.showMode(); + } else { + this.showMode(-1); + } + this.fill(); + } + + // Clicked on a year + if (target.hasClass('year') + || target.hasClass('decade') + || target.hasClass('century')) { + this.viewDate.setUTCDate(1); + + day = 1; + month = 0; + year = parseInt(target.text(), 10)||0; + this.viewDate.setUTCFullYear(year); + + if (target.hasClass('year')){ + this._trigger('changeYear', this.viewDate); + if (this.o.minViewMode === 2){ this._setDate(UTCDate(year, month, day)); } - break; + } + if (target.hasClass('decade')){ + this._trigger('changeDecade', this.viewDate); + if (this.o.minViewMode === 3){ + this._setDate(UTCDate(year, month, day)); + } + } + if (target.hasClass('century')){ + this._trigger('changeCentury', this.viewDate); + if (this.o.minViewMode === 4){ + this._setDate(UTCDate(year, month, day)); + } + } + + this.showMode(-1); + this.fill(); } } + if (this.picker.is(':visible') && this._focused_from){ $(this._focused_from).focus(); } @@ -1228,29 +1332,33 @@ _setDate: function(date, which){ if (!which || which === 'date') this._toggle_multidate(date && new Date(date)); - if (!which || which === 'view') + if (!which || which === 'view') this.viewDate = date && new Date(date); this.fill(); this.setValue(); - if (!which || which !== 'view') { + if (!which || which !== 'view') { this._trigger('changeDate'); } - var element; - if (this.isInput){ - element = this.element; - } - else if (this.component){ - element = this.element.find('input'); - } - if (element){ - element.change(); + if (this.inputField){ + this.inputField.change(); } if (this.o.autoclose && (!which || which === 'date')){ this.hide(); } }, + moveDay: function(date, dir){ + var newDate = new Date(date); + newDate.setUTCDate(date.getUTCDate() + dir); + + return newDate; + }, + + moveWeek: function(date, dir){ + return this.moveDay(date, dir * 7); + }, + moveMonth: function(date, dir){ if (!isValidDate(date)) return this.o.defaultViewDate; @@ -1305,6 +1413,33 @@ return this.moveMonth(date, dir*12); }, + moveAvailableDate: function(date, dir, fn){ + do { + date = this[fn](date, dir); + + if (!this.dateWithinRange(date)) + return false; + + fn = 'moveDay'; + } + while (this.dateIsDisabled(date)); + + return date; + }, + + weekOfDateIsDisabled: function(date){ + return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1; + }, + + dateIsDisabled: function(date){ + return ( + this.weekOfDateIsDisabled(date) || + $.grep(this.o.datesDisabled, function(d){ + return isUTCEquals(date, d); + }).length > 0 + ); + }, + dateWithinRange: function(date){ return date >= this.o.startDate && date <= this.o.endDate; }, @@ -1318,7 +1453,7 @@ return; } var dateChanged = false, - dir, newDate, newViewDate, + dir, newViewDate, focusDate = this.focusDate || this.viewDate; switch (e.keyCode){ case 27: // escape @@ -1333,69 +1468,52 @@ e.stopPropagation(); break; case 37: // left - case 39: // right - if (!this.o.keyboardNavigation) - break; - dir = e.keyCode === 37 ? -1 : 1; - if (e.ctrlKey){ - newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir); - newViewDate = this.moveYear(focusDate, dir); - this._trigger('changeYear', this.viewDate); - } - else if (e.shiftKey){ - newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir); - newViewDate = this.moveMonth(focusDate, dir); - this._trigger('changeMonth', this.viewDate); - } - else { - newDate = new Date(this.dates.get(-1) || UTCToday()); - newDate.setUTCDate(newDate.getUTCDate() + dir); - newViewDate = new Date(focusDate); - newViewDate.setUTCDate(focusDate.getUTCDate() + dir); - } - if (this.dateWithinRange(newViewDate)){ - this.focusDate = this.viewDate = newViewDate; - this.setValue(); - this.fill(); - e.preventDefault(); - } - break; case 38: // up + case 39: // right case 40: // down - if (!this.o.keyboardNavigation) + if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7) break; - dir = e.keyCode === 38 ? -1 : 1; - if (e.ctrlKey){ - newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir); - newViewDate = this.moveYear(focusDate, dir); - this._trigger('changeYear', this.viewDate); - } - else if (e.shiftKey){ - newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir); - newViewDate = this.moveMonth(focusDate, dir); - this._trigger('changeMonth', this.viewDate); - } - else { - newDate = new Date(this.dates.get(-1) || UTCToday()); - newDate.setUTCDate(newDate.getUTCDate() + dir * 7); - newViewDate = new Date(focusDate); - newViewDate.setUTCDate(focusDate.getUTCDate() + dir * 7); - } - if (this.dateWithinRange(newViewDate)){ + dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1; + if (this.viewMode === 0) { + if (e.ctrlKey){ + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear'); + + if (newViewDate) + this._trigger('changeYear', this.viewDate); + } + else if (e.shiftKey){ + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth'); + + if (newViewDate) + this._trigger('changeMonth', this.viewDate); + } + else if (e.keyCode === 37 || e.keyCode === 39){ + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay'); + } + else if (!this.weekOfDateIsDisabled(focusDate)){ + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek'); + } + } else if (this.viewMode === 1) { + if (e.keyCode === 38 || e.keyCode === 40) { + dir = dir * 4; + } + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth'); + } else if (this.viewMode === 2) { + if (e.keyCode === 38 || e.keyCode === 40) { + dir = dir * 4; + } + newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear'); + } + if (newViewDate){ this.focusDate = this.viewDate = newViewDate; this.setValue(); this.fill(); e.preventDefault(); } break; - case 32: // spacebar - // Spacebar is used in manually typing dates in some formats. - // As such, its behavior should not be hijacked. - break; case 13: // enter - if (!this.o.forceParse) { - break; - } + if (!this.o.forceParse) + break; focusDate = this.focusDate || this.dates.get(-1) || this.viewDate; if (this.o.keyboardNavigation) { this._toggle_multidate(focusDate); @@ -1407,11 +1525,7 @@ this.fill(); if (this.picker.is(':visible')){ e.preventDefault(); - if (typeof e.stopPropagation === 'function') { - e.stopPropagation(); // All modern browsers, IE9+ - } else { - e.cancelBubble = true; // IE6,7,8 ignore "stopPropagation" - } + e.stopPropagation(); if (this.o.autoclose) this.hide(); } @@ -1428,15 +1542,8 @@ this._trigger('changeDate'); else this._trigger('clearDate'); - var element; - if (this.isInput){ - element = this.element; - } - else if (this.component){ - element = this.element.find('input'); - } - if (element){ - element.change(); + if (this.inputField){ + this.inputField.change(); } } }, @@ -1455,6 +1562,7 @@ }; var DateRangePicker = function(element, options){ + $(element).data('datepicker', this); this.element = $(element); this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; @@ -1585,14 +1693,15 @@ // Options priority: js args, data-attrs, locales, defaults opts = $.extend({}, defaults, locopts, elopts, options); if ($this.hasClass('input-daterange') || opts.inputs){ - var ropts = { + $.extend(opts, { inputs: opts.inputs || $this.find('input').toArray() - }; - $this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts)))); + }); + data = new DateRangePicker(this, opts); } else { - $this.data('datepicker', (data = new Datepicker(this, opts))); + data = new Datepicker(this, opts); } + $this.data('datepicker', data); } if (typeof option === 'string' && typeof data[option] === 'function'){ internal_return = data[option].apply(data, args); @@ -1614,10 +1723,13 @@ $.fn.datepicker = datepickerPlugin; var defaults = $.fn.datepicker.defaults = { + assumeNearbyYear: false, autoclose: false, beforeShowDay: $.noop, beforeShowMonth: $.noop, beforeShowYear: $.noop, + beforeShowDecade: $.noop, + beforeShowCentury: $.noop, calendarWeeks: false, clearBtn: false, toggleActive: false, @@ -1630,7 +1742,7 @@ keyboardNavigation: true, language: 'en', minViewMode: 0, - maxViewMode: 2, + maxViewMode: 4, multidate: false, multidateSeparator: ',', orientation: "auto", @@ -1642,9 +1754,15 @@ weekStart: 0, disableTouchKeyboard: false, enableOnReadonly: true, + showOnFocus: true, + zIndexOffset: 10, container: 'body', immediateUpdates: false, - title: '' + title: '', + templates: { + leftArrow: '«', + rightArrow: '»' + } }; var locale_opts = $.fn.datepicker.locale_opts = [ 'format', @@ -1681,6 +1799,16 @@ clsName: 'years', navFnc: 'FullYear', navStep: 10 + }, + { + clsName: 'decades', + navFnc: 'FullDecade', + navStep: 100 + }, + { + clsName: 'centuries', + navFnc: 'FullCentury', + navStep: 1000 }], isLeapYear: function(year){ return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)); @@ -1689,7 +1817,7 @@ return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; }, validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, - nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g, + nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g, parseFormat: function(format){ if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function') return format; @@ -1702,7 +1830,7 @@ } return {separators: separators, parts: parts}; }, - parseDate: function(date, format, language){ + parseDate: function(date, format, language, assumeNearby){ if (!date) return undefined; if (date instanceof Date) @@ -1713,39 +1841,73 @@ return format.toValue(date, format, language); var part_re = /([\-+]\d+)([dmwy])/, parts = date.match(/([\-+]\d+)([dmwy])/g), - part, dir, i; + fn_map = { + d: 'moveDay', + m: 'moveMonth', + w: 'moveWeek', + y: 'moveYear' + }, + dateAliases = { + yesterday: '-1d', + today: '+0d', + tomorrow: '+1d' + }, + part, dir, i, fn; if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){ date = new Date(); for (i=0; i < parts.length; i++){ part = part_re.exec(parts[i]); dir = parseInt(part[1]); - switch (part[2]){ - case 'd': - date.setUTCDate(date.getUTCDate() + dir); - break; - case 'm': - date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir); - break; - case 'w': - date.setUTCDate(date.getUTCDate() + dir * 7); - break; - case 'y': - date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir); - break; - } + fn = fn_map[part[2]]; + date = Datepicker.prototype[fn](date, dir); } - return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0); + return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()); } + + if (typeof dateAliases[date] !== 'undefined') { + date = dateAliases[date]; + parts = date.match(/([\-+]\d+)([dmwy])/g); + + if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){ + date = new Date(); + for (i=0; i < parts.length; i++){ + part = part_re.exec(parts[i]); + dir = parseInt(part[1]); + fn = fn_map[part[2]]; + date = Datepicker.prototype[fn](date, dir); + } + + return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()); + } + } + parts = date && date.match(this.nonpunctuation) || []; date = new Date(); + + function applyNearbyYear(year, threshold){ + if (threshold === true) + threshold = 10; + + // if year is 2 digits or less, than the user most likely is trying to get a recent century + if (year < 100){ + year += 2000; + // if the new year is more than threshold years in advance, use last century + if (year > ((new Date()).getFullYear()+threshold)){ + year -= 100; + } + } + + return year; + } + var parsed = {}, setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'], setters_map = { yyyy: function(d,v){ - return d.setUTCFullYear(v); + return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v); }, yy: function(d,v){ - return d.setUTCFullYear(2000+v); + return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v); }, m: function(d,v){ if (isNaN(d)) @@ -1765,7 +1927,7 @@ val, filtered; setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m']; setters_map['dd'] = setters_map['d']; - date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); + date = UTCToday(); var fparts = format.parts.slice(); // Remove noop parts if (parts.length !== fparts.length){ @@ -1844,9 +2006,9 @@ ''+ ''+ ''+ - '«'+ + '«'+ ''+ - '»'+ + '»'+ ''+ '', contTemplate: '', @@ -1861,7 +2023,7 @@ }; DPGlobal.template = '
'+ '
'+ - ''+ + '
'+ DPGlobal.headTemplate+ ''+ DPGlobal.footTemplate+ @@ -1881,6 +2043,20 @@ DPGlobal.footTemplate+ '
'+ '
'+ + '
'+ + ''+ + DPGlobal.headTemplate+ + DPGlobal.contTemplate+ + DPGlobal.footTemplate+ + '
'+ + '
'+ + '
'+ + ''+ + DPGlobal.headTemplate+ + DPGlobal.contTemplate+ + DPGlobal.footTemplate+ + '
'+ + '
'+ '
'; $.fn.datepicker.DPGlobal = DPGlobal; @@ -1896,7 +2072,7 @@ /* DATEPICKER VERSION * =================== */ - $.fn.datepicker.version = '1.5.0'; + $.fn.datepicker.version = '1.6.4'; /* DATEPICKER DATA-API * ================== */ diff --git a/public/js/datepicker-locales/bootstrap-datepicker.ar-tn.js b/public/js/datepicker-locales/bootstrap-datepicker.ar-tn.js new file mode 100644 index 0000000..110fe91 --- /dev/null +++ b/public/js/datepicker-locales/bootstrap-datepicker.ar-tn.js @@ -0,0 +1,15 @@ +/** + * Arabic-Tunisia translation for bootstrap-datepicker + * Souhaieb Besbes + */ +;(function($){ + $.fn.datepicker.dates['ar-tn'] = { + days: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"], + daysShort: ["أحد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت", "أحد"], + daysMin: ["ح", "ن", "ث", "ع", "خ", "ج", "س", "ح"], + months: ["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويليه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"], + monthsShort: ["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويليه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"], + today: "هذا اليوم", + rtl: true + }; +}(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.ca.js b/public/js/datepicker-locales/bootstrap-datepicker.ca.js index d4e7e9a..6ba993c 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.ca.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.ca.js @@ -10,6 +10,7 @@ months: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], monthsShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], today: "Avui", + monthsTitle: "Mesos", clear: "Esborrar", weekStart: 1, format: "dd/mm/yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.cs.js b/public/js/datepicker-locales/bootstrap-datepicker.cs.js index 8cc17d6..89c8438 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.cs.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.cs.js @@ -12,6 +12,7 @@ monthsShort: ["Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čnc", "Srp", "Zář", "Říj", "Lis", "Pro"], today: "Dnes", clear: "Vymazat", + monthsTitle: "Měsíc", weekStart: 1, format: "dd.m.yyyy" }; diff --git a/public/js/datepicker-locales/bootstrap-datepicker.da.js b/public/js/datepicker-locales/bootstrap-datepicker.da.js index 540dd6d..a9c4240 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.da.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.da.js @@ -5,12 +5,14 @@ */ ;(function($){ $.fn.datepicker.dates['da'] = { - days: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], - daysShort: ["søn", "man", "tir", "ons", "tor", "fre", "lør"], - daysMin: ["sø", "ma", "ti", "on", "to", "fr", "lø"], - months: ["januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"], - monthsShort: ["jan", "feb", "mar", "apr", "maj", "jun", "jul", "aug", "sep", "okt", "nov", "dec"], + days: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], + daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"], + daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø"], + months: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], today: "I Dag", - clear: "Nulstil" + weekStart: 1, + clear: "Nulstil", + format: "dd-mm-yyyy" }; }(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.de.js b/public/js/datepicker-locales/bootstrap-datepicker.de.js index a04d8f1..52e7a9b 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.de.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.de.js @@ -10,6 +10,7 @@ months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], monthsShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], today: "Heute", + monthsTitle: "Monate", clear: "Löschen", weekStart: 1, format: "dd.mm.yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.en-AU.js b/public/js/datepicker-locales/bootstrap-datepicker.en-AU.js new file mode 100644 index 0000000..5f1fa24 --- /dev/null +++ b/public/js/datepicker-locales/bootstrap-datepicker.en-AU.js @@ -0,0 +1,18 @@ +/** + * Australian English translation for bootstrap-datepicker + * Steve Chapman + */ +;(function($){ + $.fn.datepicker.dates['en-AU'] = { + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + today: "Today", + monthsTitle: "Months", + clear: "Clear", + weekStart: 1, + format: "d/mm/yyyy" + }; +}(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.en-GB.js b/public/js/datepicker-locales/bootstrap-datepicker.en-GB.js index 4e0e57d..4f09467 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.en-GB.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.en-GB.js @@ -10,6 +10,7 @@ months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], today: "Today", + monthsTitle: "Months", clear: "Clear", weekStart: 1, format: "dd/mm/yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.en-IE.js b/public/js/datepicker-locales/bootstrap-datepicker.en-IE.js new file mode 100644 index 0000000..188e4fc --- /dev/null +++ b/public/js/datepicker-locales/bootstrap-datepicker.en-IE.js @@ -0,0 +1,17 @@ +/** + * Irish English translation for bootstrap-datepicker + */ +;(function($){ + $.fn.datepicker.dates['en-IE'] = { + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + today: "Today", + monthsTitle: "Months", + clear: "Clear", + weekStart: 1, + format: "dd/mm/yyyy" + }; +}(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.en-NZ.js b/public/js/datepicker-locales/bootstrap-datepicker.en-NZ.js new file mode 100644 index 0000000..9b6910b --- /dev/null +++ b/public/js/datepicker-locales/bootstrap-datepicker.en-NZ.js @@ -0,0 +1,17 @@ +/** + * New Zealand English translation for bootstrap-datepicker + */ +;(function($){ + $.fn.datepicker.dates['en-NZ'] = { + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + today: "Today", + monthsTitle: "Months", + clear: "Clear", + weekStart: 1, + format: "d/mm/yyyy" + }; +}(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.en-ZA.js b/public/js/datepicker-locales/bootstrap-datepicker.en-ZA.js new file mode 100644 index 0000000..54b68f8 --- /dev/null +++ b/public/js/datepicker-locales/bootstrap-datepicker.en-ZA.js @@ -0,0 +1,17 @@ +/** + * South African English translation for bootstrap-datepicker + */ +;(function($){ + $.fn.datepicker.dates['en-ZA'] = { + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + today: "Today", + monthsTitle: "Months", + clear: "Clear", + weekStart: 1, + format: "yyyy/mm/d" + }; +}(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.es.js b/public/js/datepicker-locales/bootstrap-datepicker.es.js index 12b729c..ac9dd35 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.es.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.es.js @@ -10,6 +10,7 @@ months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], today: "Hoy", + monthsTitle: "Meses", clear: "Borrar", weekStart: 1, format: "dd/mm/yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.fr-CH.js b/public/js/datepicker-locales/bootstrap-datepicker.fr-CH.js index c1fb27b..79b5026 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.fr-CH.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.fr-CH.js @@ -13,6 +13,7 @@ months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], monthsShort: ["Jan", "Fév", "Mar", "Avr", "Mai", "Jui", "Jul", "Aou", "Sep", "Oct", "Nov", "Déc"], today: "Aujourd'hui", + monthsTitle: "Mois", clear: "Effacer", weekStart: 1, format: "dd.mm.yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.fr.js b/public/js/datepicker-locales/bootstrap-datepicker.fr.js index ef430a0..df65ed6 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.fr.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.fr.js @@ -10,6 +10,7 @@ months: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], monthsShort: ["janv.", "févr.", "mars", "avril", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."], today: "Aujourd'hui", + monthsTitle: "Mois", clear: "Effacer", weekStart: 1, format: "dd/mm/yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.hy.js b/public/js/datepicker-locales/bootstrap-datepicker.hy.js index a923c05..7c7e8f1 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.hy.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.hy.js @@ -5,10 +5,10 @@ ;(function($){ $.fn.datepicker.dates['hy'] = { days: ["Կիրակի", "Երկուշաբթի", "Երեքշաբթի", "Չորեքշաբթի", "Հինգշաբթի", "Ուրբաթ", "Շաբաթ"], - daysShort: ["Կիր", "Երկ", "Երք", "Չոր", "Հնգ", "Ուր", "Շաբ"], - daysMin: ["Կի", "Եկ", "Եք", "Չո", "Հի", "Ու", "Շա"], + daysShort: ["Կրկ", "Երկ", "Երք", "Չրք", "Հնգ", "Ուր", "Շբթ"], + daysMin: ["Կրկ", "Երկ", "Երք", "Չրք", "Հնգ", "Ուր", "Շբթ"], months: ["Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"], - monthsShort: ["Հնվ", "Փետ", "Մար", "Ապր", "Մայ", "Հուն", "Հուլ", "Օգս", "Սեպ", "Հոկ", "Նոյ", "Դեկ"], + monthsShort: ["Հուն", "Փետ", "Մար", "Ապր", "Մայ", "Հնս", "Հլս", "Օգս", "Սեպ", "Հոկ", "Նմբ", "Դեկ"], today: "Այսօր", clear: "Ջնջել", format: "dd.mm.yyyy", diff --git a/public/js/datepicker-locales/bootstrap-datepicker.it.js b/public/js/datepicker-locales/bootstrap-datepicker.it.js index e97e2cd..1722031 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.it.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.it.js @@ -10,6 +10,7 @@ months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], monthsShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], today: "Oggi", + monthsTitle: "Mesi", clear: "Cancella", weekStart: 1, format: "dd/mm/yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.kh.js b/public/js/datepicker-locales/bootstrap-datepicker.kh.js index 681ae87..c4ce130 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.kh.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.kh.js @@ -1,12 +1,16 @@ /** * Cambodia (Khmer) translation for bootstrap-datepicker * Lytay TOUCH + * + * DEPRECATED: This language code 'kh' is deprecated and will be removed in 2.0. + * Khmer support is now in a 'km' translation file to follow the ISO language + * code - http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes */ ;(function($){ $.fn.datepicker.dates['kh'] = { - days: ["អាទិត្យ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រហស្បតិ៍", "សុក្រ", "សៅរ៍", "អាទិត្យ"], - daysShort: ["អា.ទិ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រ.ហ", "សុក្រ", "សៅរ៍", "អា.ទិ"], - daysMin: ["អា.ទិ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រ.ហ", "សុក្រ", "សៅរ៍", "អា.ទិ"], + days: ["អាទិត្យ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រហស្បតិ៍", "សុក្រ", "សៅរ៍"], + daysShort: ["អា.ទិ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រ.ហ", "សុក្រ", "សៅរ៍"], + daysMin: ["អា.ទិ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រ.ហ", "សុក្រ", "សៅរ៍"], months: ["មករា", "កុម្ភះ", "មិនា", "មេសា", "ឧសភា", "មិថុនា", "កក្កដា", "សីហា", "កញ្ញា", "តុលា", "វិច្ឆិកា", "ធ្នូ"], monthsShort: ["មករា", "កុម្ភះ", "មិនា", "មេសា", "ឧសភា", "មិថុនា", "កក្កដា", "សីហា", "កញ្ញា", "តុលា", "វិច្ឆិកា", "ធ្នូ"], today: "ថ្ងៃនេះ", diff --git a/public/js/datepicker-locales/bootstrap-datepicker.kk.js b/public/js/datepicker-locales/bootstrap-datepicker.kk.js index e301ecf..9ffa8ca 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.kk.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.kk.js @@ -8,7 +8,7 @@ daysShort: ["Жек", "Дүй", "Сей", "Сәр", "Бей", "Жұм", "Сен"], daysMin: ["Жк", "Дс", "Сс", "Ср", "Бс", "Жм", "Сн"], months: ["Қаңтар", "Ақпан", "Наурыз", "Сәуір", "Мамыр", "Маусым", "Шілде", "Тамыз", "Қыркүйек", "Қазан", "Қараша", "Желтоқсан"], - monthsShort: ["Қаң", "Ақп", "Нау", "Сәу", "Мамыр", "Мау", "Шлд", "Тмз", "Қыр", "Қзн", "Қар", "Жел"], + monthsShort: ["Қаң", "Ақп", "Нау", "Сәу", "Мам", "Мау", "Шіл", "Там", "Қыр", "Қаз", "Қар", "Жел"], today: "Бүгін", weekStart: 1 }; diff --git a/public/js/datepicker-locales/bootstrap-datepicker.km.js b/public/js/datepicker-locales/bootstrap-datepicker.km.js new file mode 100644 index 0000000..d142846 --- /dev/null +++ b/public/js/datepicker-locales/bootstrap-datepicker.km.js @@ -0,0 +1,15 @@ +/** + * Khmer translation for bootstrap-datepicker + * This is the Updated Version of: https://github.com/eternicode/bootstrap-datepicker/blob/71308d42cce9524284c50c6fac50422d1790ac0f/js/locales/bootstrap-datepicker.kh.js + */ +;(function($){ + $.fn.datepicker.dates['km'] = { + days: ["អាទិត្យ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រហស្បតិ៍", "សុក្រ", "សៅរ៍"], + daysShort: ["អា.ទិ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រ.ហ", "សុក្រ", "សៅរ៍"], + daysMin: ["អា.ទិ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រ.ហ", "សុក្រ", "សៅរ៍"], + months: ["មករា", "កុម្ភះ", "មិនា", "មេសា", "ឧសភា", "មិថុនា", "កក្កដា", "សីហា", "កញ្ញា", "តុលា", "វិច្ឆិកា", "ធ្នូ"], + monthsShort: ["មករា", "កុម្ភះ", "មិនា", "មេសា", "ឧសភា", "មិថុនា", "កក្កដា", "សីហា", "កញ្ញា", "តុលា", "វិច្ឆិកា", "ធ្នូ"], + today: "ថ្ងៃនេះ", + clear: "សំអាត" + }; +}(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.ko.js b/public/js/datepicker-locales/bootstrap-datepicker.ko.js index 122b68b..95514b2 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.ko.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.ko.js @@ -11,7 +11,7 @@ monthsShort: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], today: "오늘", clear: "삭제", - format: "YYYY-MM-DD", + format: "yyyy-mm-dd", titleFormat: "yyyy년mm월", weekStart: 0 }; diff --git a/public/js/datepicker-locales/bootstrap-datepicker.lt.js b/public/js/datepicker-locales/bootstrap-datepicker.lt.js index 41e378f..4845f26 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.lt.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.lt.js @@ -11,6 +11,9 @@ months: ["Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"], monthsShort: ["Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugp", "Rugs", "Spa", "Lap", "Gru"], today: "Šiandien", - weekStart: 1 + monthsTitle:"Mėnesiai", + clear:"Išvalyti", + weekStart: 1, + format:"yyyy-mm-dd" }; }(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.nb.js b/public/js/datepicker-locales/bootstrap-datepicker.nb.js index 9d138c1..9414edd 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.nb.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.nb.js @@ -9,6 +9,7 @@ daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø"], months: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], - today: "I Dag" + today: "I Dag", + format: "dd.mm.yyyy" }; }(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.nl-BE.js b/public/js/datepicker-locales/bootstrap-datepicker.nl-BE.js index 5bd5c70..aadc374 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.nl-BE.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.nl-BE.js @@ -10,6 +10,7 @@ months: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"], monthsShort: ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"], today: "Vandaag", + monthsTitle: "Maanden", clear: "Leegmaken", weekStart: 1, format: "dd/mm/yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.nl.js b/public/js/datepicker-locales/bootstrap-datepicker.nl.js index 7926715..bef19cf 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.nl.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.nl.js @@ -10,6 +10,7 @@ months: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"], monthsShort: ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"], today: "Vandaag", + monthsTitle: "Maanden", clear: "Wissen", weekStart: 1, format: "dd-mm-yyyy" diff --git a/public/js/datepicker-locales/bootstrap-datepicker.pl.js b/public/js/datepicker-locales/bootstrap-datepicker.pl.js index 74e02ff..26c7ae8 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.pl.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.pl.js @@ -4,14 +4,14 @@ */ ;(function($){ $.fn.datepicker.dates['pl'] = { - days: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"], - daysShort: ["niedz.", "pon.", "wt.", "śr.", "czw.", "piąt.", "sob."], - daysMin: ["ndz.", "pn.", "wt.", "śr.", "czw.", "pt.", "sob."], - months: ["styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"], - monthsShort: ["sty.", "lut.", "mar.", "kwi.", "maj", "cze.", "lip.", "sie.", "wrz.", "paź.", "lis.", "gru."], - today: "dzisiaj", + days: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], + daysShort: ["Niedz.", "Pon.", "Wt.", "Śr.", "Czw.", "Piąt.", "Sob."], + daysMin: ["Ndz.", "Pn.", "Wt.", "Śr.", "Czw.", "Pt.", "Sob."], + months: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], + monthsShort: ["Sty.", "Lut.", "Mar.", "Kwi.", "Maj", "Cze.", "Lip.", "Sie.", "Wrz.", "Paź.", "Lis.", "Gru."], + today: "Dzisiaj", weekStart: 1, - clear: "wyczyść", + clear: "Wyczyść", format: "dd.mm.yyyy" }; }(jQuery)); diff --git a/public/js/datepicker-locales/bootstrap-datepicker.pt-BR.js b/public/js/datepicker-locales/bootstrap-datepicker.pt-BR.js index 44106ff..852160b 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.pt-BR.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.pt-BR.js @@ -10,6 +10,7 @@ months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], today: "Hoje", + monthsTitle: "Meses", clear: "Limpar", format: "dd/mm/yyyy" }; diff --git a/public/js/datepicker-locales/bootstrap-datepicker.pt.js b/public/js/datepicker-locales/bootstrap-datepicker.pt.js index 67dff3e..011e01e 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.pt.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.pt.js @@ -11,6 +11,7 @@ months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], today: "Hoje", + monthsTitle: "Meses", clear: "Limpar", format: "dd/mm/yyyy" }; diff --git a/public/js/datepicker-locales/bootstrap-datepicker.rs-latin.js b/public/js/datepicker-locales/bootstrap-datepicker.rs-latin.js index d13766a..6de5289 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.rs-latin.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.rs-latin.js @@ -1,6 +1,8 @@ /** * Serbian latin translation for bootstrap-datepicker * Bojan Milosavlević + * + * * DEPRECATED: This language code 'rs' is deprecated (invalid serbian language code) and will be removed in 2.0. Use the 'sr' language code as an replacement */ ;(function($){ $.fn.datepicker.dates['rs-latin'] = { diff --git a/public/js/datepicker-locales/bootstrap-datepicker.rs.js b/public/js/datepicker-locales/bootstrap-datepicker.rs.js index ec22e5a..699660d 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.rs.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.rs.js @@ -1,6 +1,8 @@ /** * Serbian cyrillic translation for bootstrap-datepicker * Bojan Milosavlević + * + * DEPRECATED: This language code 'rs' is deprecated (invalid serbian language code) and will be removed in 2.0. Use the 'sr' language code as an replacement */ ;(function($){ $.fn.datepicker.dates['rs'] = { diff --git a/public/js/datepicker-locales/bootstrap-datepicker.sk.js b/public/js/datepicker-locales/bootstrap-datepicker.sk.js index f8e2d23..3881386 100644 --- a/public/js/datepicker-locales/bootstrap-datepicker.sk.js +++ b/public/js/datepicker-locales/bootstrap-datepicker.sk.js @@ -11,6 +11,8 @@ months: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], today: "Dnes", - format: "dd.mm.yyyy" + clear: "Vymazať", + weekStart: 1, + format: "d.m.yyyy" }; }(jQuery));