card-mod-date 0.15.4 → 0.15.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/vendor/moment/CHANGELOG.md +964 -0
- data/vendor/moment/CONTRIBUTING.md +103 -0
- data/vendor/moment/FAQ.md +28 -0
- data/vendor/moment/Gruntfile.js +255 -0
- data/vendor/moment/LICENSE +22 -0
- data/vendor/moment/Moment.js.nuspec +31 -0
- data/vendor/moment/README.md +55 -0
- data/vendor/moment/benchmarks/add.js +22 -0
- data/vendor/moment/benchmarks/clone.js +10 -0
- data/vendor/moment/benchmarks/compare.js +33 -0
- data/vendor/moment/benchmarks/endOf.js +22 -0
- data/vendor/moment/benchmarks/fromDate.js +12 -0
- data/vendor/moment/benchmarks/fromDateUtc.js +12 -0
- data/vendor/moment/benchmarks/get.js +21 -0
- data/vendor/moment/benchmarks/isObjectEmpty.js +67 -0
- data/vendor/moment/benchmarks/load-missing.js +13 -0
- data/vendor/moment/benchmarks/makeDuration.js +11 -0
- data/vendor/moment/benchmarks/query.js +40 -0
- data/vendor/moment/benchmarks/set.js +22 -0
- data/vendor/moment/benchmarks/startOf.js +22 -0
- data/vendor/moment/benchmarks/subtract.js +22 -0
- data/vendor/moment/benchmarks/zeroFill.js +43 -0
- data/vendor/moment/bower.json +26 -0
- data/vendor/moment/component.json +147 -0
- data/vendor/moment/composer.json +33 -0
- data/vendor/moment/dist/locale/af.js +71 -0
- data/vendor/moment/dist/locale/ar-dz.js +156 -0
- data/vendor/moment/dist/locale/ar-kw.js +54 -0
- data/vendor/moment/dist/locale/ar-ly.js +171 -0
- data/vendor/moment/dist/locale/ar-ma.js +55 -0
- data/vendor/moment/dist/locale/ar-sa.js +104 -0
- data/vendor/moment/dist/locale/ar-tn.js +54 -0
- data/vendor/moment/dist/locale/ar.js +189 -0
- data/vendor/moment/dist/locale/az.js +101 -0
- data/vendor/moment/dist/locale/be.js +141 -0
- data/vendor/moment/dist/locale/bg.js +87 -0
- data/vendor/moment/dist/locale/bm.js +52 -0
- data/vendor/moment/dist/locale/bn-bd.js +128 -0
- data/vendor/moment/dist/locale/bn.js +118 -0
- data/vendor/moment/dist/locale/bo.js +122 -0
- data/vendor/moment/dist/locale/br.js +165 -0
- data/vendor/moment/dist/locale/bs.js +149 -0
- data/vendor/moment/dist/locale/ca.js +97 -0
- data/vendor/moment/dist/locale/cs.js +171 -0
- data/vendor/moment/dist/locale/cv.js +62 -0
- data/vendor/moment/dist/locale/cy.js +97 -0
- data/vendor/moment/dist/locale/da.js +53 -0
- data/vendor/moment/dist/locale/de-at.js +79 -0
- data/vendor/moment/dist/locale/de-ch.js +78 -0
- data/vendor/moment/dist/locale/de.js +78 -0
- data/vendor/moment/dist/locale/dv.js +90 -0
- data/vendor/moment/dist/locale/el.js +104 -0
- data/vendor/moment/dist/locale/en-au.js +68 -0
- data/vendor/moment/dist/locale/en-ca.js +64 -0
- data/vendor/moment/dist/locale/en-gb.js +68 -0
- data/vendor/moment/dist/locale/en-ie.js +68 -0
- data/vendor/moment/dist/locale/en-il.js +64 -0
- data/vendor/moment/dist/locale/en-in.js +68 -0
- data/vendor/moment/dist/locale/en-nz.js +68 -0
- data/vendor/moment/dist/locale/en-sg.js +68 -0
- data/vendor/moment/dist/locale/eo.js +68 -0
- data/vendor/moment/dist/locale/es-do.js +104 -0
- data/vendor/moment/dist/locale/es-mx.js +106 -0
- data/vendor/moment/dist/locale/es-us.js +106 -0
- data/vendor/moment/dist/locale/es.js +106 -0
- data/vendor/moment/dist/locale/et.js +78 -0
- data/vendor/moment/dist/locale/eu.js +63 -0
- data/vendor/moment/dist/locale/fa.js +110 -0
- data/vendor/moment/dist/locale/fi.js +121 -0
- data/vendor/moment/dist/locale/fil.js +58 -0
- data/vendor/moment/dist/locale/fo.js +56 -0
- data/vendor/moment/dist/locale/fr-ca.js +69 -0
- data/vendor/moment/dist/locale/fr-ch.js +73 -0
- data/vendor/moment/dist/locale/fr.js +104 -0
- data/vendor/moment/dist/locale/fy.js +77 -0
- data/vendor/moment/dist/locale/ga.js +95 -0
- data/vendor/moment/dist/locale/gd.js +95 -0
- data/vendor/moment/dist/locale/gl.js +74 -0
- data/vendor/moment/dist/locale/gom-deva.js +124 -0
- data/vendor/moment/dist/locale/gom-latn.js +124 -0
- data/vendor/moment/dist/locale/gu.js +121 -0
- data/vendor/moment/dist/locale/he.js +94 -0
- data/vendor/moment/dist/locale/hi.js +119 -0
- data/vendor/moment/dist/locale/hr.js +154 -0
- data/vendor/moment/dist/locale/hu.js +118 -0
- data/vendor/moment/dist/locale/hy-am.js +92 -0
- data/vendor/moment/dist/locale/id.js +76 -0
- data/vendor/moment/dist/locale/is.js +139 -0
- data/vendor/moment/dist/locale/it-ch.js +64 -0
- data/vendor/moment/dist/locale/it.js +106 -0
- data/vendor/moment/dist/locale/ja.js +148 -0
- data/vendor/moment/dist/locale/jv.js +76 -0
- data/vendor/moment/dist/locale/ka.js +92 -0
- data/vendor/moment/dist/locale/kk.js +82 -0
- data/vendor/moment/dist/locale/km.js +102 -0
- data/vendor/moment/dist/locale/kn.js +123 -0
- data/vendor/moment/dist/locale/ko.js +75 -0
- data/vendor/moment/dist/locale/ku.js +118 -0
- data/vendor/moment/dist/locale/ky.js +84 -0
- data/vendor/moment/dist/locale/lb.js +135 -0
- data/vendor/moment/dist/locale/lo.js +65 -0
- data/vendor/moment/dist/locale/lt.js +123 -0
- data/vendor/moment/dist/locale/lv.js +93 -0
- data/vendor/moment/dist/locale/me.js +118 -0
- data/vendor/moment/dist/locale/mi.js +59 -0
- data/vendor/moment/dist/locale/mk.js +85 -0
- data/vendor/moment/dist/locale/ml.js +80 -0
- data/vendor/moment/dist/locale/mn.js +99 -0
- data/vendor/moment/dist/locale/mr.js +202 -0
- data/vendor/moment/dist/locale/ms-my.js +76 -0
- data/vendor/moment/dist/locale/ms.js +75 -0
- data/vendor/moment/dist/locale/mt.js +55 -0
- data/vendor/moment/dist/locale/my.js +91 -0
- data/vendor/moment/dist/locale/nb.js +61 -0
- data/vendor/moment/dist/locale/ne.js +120 -0
- data/vendor/moment/dist/locale/nl-be.js +102 -0
- data/vendor/moment/dist/locale/nl.js +104 -0
- data/vendor/moment/dist/locale/nn.js +60 -0
- data/vendor/moment/dist/locale/oc-lnc.js +83 -0
- data/vendor/moment/dist/locale/pa-in.js +121 -0
- data/vendor/moment/dist/locale/pl.js +139 -0
- data/vendor/moment/dist/locale/pt-br.js +57 -0
- data/vendor/moment/dist/locale/pt.js +62 -0
- data/vendor/moment/dist/locale/ro.js +75 -0
- data/vendor/moment/dist/locale/ru.js +206 -0
- data/vendor/moment/dist/locale/sd.js +81 -0
- data/vendor/moment/dist/locale/se.js +57 -0
- data/vendor/moment/dist/locale/si.js +68 -0
- data/vendor/moment/dist/locale/sk.js +144 -0
- data/vendor/moment/dist/locale/sl.js +170 -0
- data/vendor/moment/dist/locale/sq.js +65 -0
- data/vendor/moment/dist/locale/sr-cyrl.js +116 -0
- data/vendor/moment/dist/locale/sr.js +118 -0
- data/vendor/moment/dist/locale/ss.js +83 -0
- data/vendor/moment/dist/locale/sv.js +68 -0
- data/vendor/moment/dist/locale/sw.js +54 -0
- data/vendor/moment/dist/locale/ta.js +129 -0
- data/vendor/moment/dist/locale/te.js +86 -0
- data/vendor/moment/dist/locale/tet.js +68 -0
- data/vendor/moment/dist/locale/tg.js +116 -0
- data/vendor/moment/dist/locale/th.js +64 -0
- data/vendor/moment/dist/locale/tk.js +91 -0
- data/vendor/moment/dist/locale/tl-ph.js +57 -0
- data/vendor/moment/dist/locale/tlh.js +125 -0
- data/vendor/moment/dist/locale/tr.js +106 -0
- data/vendor/moment/dist/locale/tzl.js +89 -0
- data/vendor/moment/dist/locale/tzm-latn.js +53 -0
- data/vendor/moment/dist/locale/tzm.js +53 -0
- data/vendor/moment/dist/locale/ug-cn.js +110 -0
- data/vendor/moment/dist/locale/uk.js +163 -0
- data/vendor/moment/dist/locale/ur.js +82 -0
- data/vendor/moment/dist/locale/uz-latn.js +53 -0
- data/vendor/moment/dist/locale/uz.js +51 -0
- data/vendor/moment/dist/locale/vi.js +79 -0
- data/vendor/moment/dist/locale/x-pseudo.js +71 -0
- data/vendor/moment/dist/locale/yo.js +53 -0
- data/vendor/moment/dist/locale/zh-cn.js +120 -0
- data/vendor/moment/dist/locale/zh-hk.js +101 -0
- data/vendor/moment/dist/locale/zh-mo.js +100 -0
- data/vendor/moment/dist/locale/zh-tw.js +99 -0
- data/vendor/moment/dist/moment.js +5663 -0
- data/vendor/moment/ender.js +1 -0
- data/vendor/moment/locale/af.js +82 -0
- data/vendor/moment/locale/ar-dz.js +167 -0
- data/vendor/moment/locale/ar-kw.js +65 -0
- data/vendor/moment/locale/ar-ly.js +182 -0
- data/vendor/moment/locale/ar-ma.js +66 -0
- data/vendor/moment/locale/ar-sa.js +115 -0
- data/vendor/moment/locale/ar-tn.js +65 -0
- data/vendor/moment/locale/ar.js +200 -0
- data/vendor/moment/locale/az.js +112 -0
- data/vendor/moment/locale/be.js +152 -0
- data/vendor/moment/locale/bg.js +98 -0
- data/vendor/moment/locale/bm.js +62 -0
- data/vendor/moment/locale/bn-bd.js +139 -0
- data/vendor/moment/locale/bn.js +129 -0
- data/vendor/moment/locale/bo.js +133 -0
- data/vendor/moment/locale/br.js +176 -0
- data/vendor/moment/locale/bs.js +160 -0
- data/vendor/moment/locale/ca.js +108 -0
- data/vendor/moment/locale/cs.js +182 -0
- data/vendor/moment/locale/cv.js +73 -0
- data/vendor/moment/locale/cy.js +108 -0
- data/vendor/moment/locale/da.js +64 -0
- data/vendor/moment/locale/de-at.js +90 -0
- data/vendor/moment/locale/de-ch.js +87 -0
- data/vendor/moment/locale/de.js +89 -0
- data/vendor/moment/locale/dv.js +101 -0
- data/vendor/moment/locale/el.js +115 -0
- data/vendor/moment/locale/en-au.js +79 -0
- data/vendor/moment/locale/en-ca.js +75 -0
- data/vendor/moment/locale/en-gb.js +79 -0
- data/vendor/moment/locale/en-ie.js +79 -0
- data/vendor/moment/locale/en-il.js +75 -0
- data/vendor/moment/locale/en-in.js +79 -0
- data/vendor/moment/locale/en-nz.js +79 -0
- data/vendor/moment/locale/en-sg.js +79 -0
- data/vendor/moment/locale/eo.js +79 -0
- data/vendor/moment/locale/es-do.js +115 -0
- data/vendor/moment/locale/es-mx.js +117 -0
- data/vendor/moment/locale/es-us.js +117 -0
- data/vendor/moment/locale/es.js +117 -0
- data/vendor/moment/locale/et.js +89 -0
- data/vendor/moment/locale/eu.js +74 -0
- data/vendor/moment/locale/fa.js +121 -0
- data/vendor/moment/locale/fi.js +132 -0
- data/vendor/moment/locale/fil.js +69 -0
- data/vendor/moment/locale/fo.js +67 -0
- data/vendor/moment/locale/fr-ca.js +80 -0
- data/vendor/moment/locale/fr-ch.js +84 -0
- data/vendor/moment/locale/fr.js +115 -0
- data/vendor/moment/locale/fy.js +88 -0
- data/vendor/moment/locale/ga.js +106 -0
- data/vendor/moment/locale/gd.js +106 -0
- data/vendor/moment/locale/gl.js +85 -0
- data/vendor/moment/locale/gom-deva.js +135 -0
- data/vendor/moment/locale/gom-latn.js +135 -0
- data/vendor/moment/locale/gu.js +132 -0
- data/vendor/moment/locale/he.js +105 -0
- data/vendor/moment/locale/hi.js +130 -0
- data/vendor/moment/locale/hr.js +165 -0
- data/vendor/moment/locale/hu.js +129 -0
- data/vendor/moment/locale/hy-am.js +103 -0
- data/vendor/moment/locale/id.js +87 -0
- data/vendor/moment/locale/is.js +150 -0
- data/vendor/moment/locale/it-ch.js +75 -0
- data/vendor/moment/locale/it.js +117 -0
- data/vendor/moment/locale/ja.js +159 -0
- data/vendor/moment/locale/jv.js +87 -0
- data/vendor/moment/locale/ka.js +103 -0
- data/vendor/moment/locale/kk.js +93 -0
- data/vendor/moment/locale/km.js +113 -0
- data/vendor/moment/locale/kn.js +134 -0
- data/vendor/moment/locale/ko.js +86 -0
- data/vendor/moment/locale/ku.js +129 -0
- data/vendor/moment/locale/ky.js +95 -0
- data/vendor/moment/locale/lb.js +146 -0
- data/vendor/moment/locale/lo.js +76 -0
- data/vendor/moment/locale/lt.js +134 -0
- data/vendor/moment/locale/lv.js +104 -0
- data/vendor/moment/locale/me.js +129 -0
- data/vendor/moment/locale/mi.js +70 -0
- data/vendor/moment/locale/mk.js +97 -0
- data/vendor/moment/locale/ml.js +91 -0
- data/vendor/moment/locale/mn.js +110 -0
- data/vendor/moment/locale/mr.js +213 -0
- data/vendor/moment/locale/ms-my.js +87 -0
- data/vendor/moment/locale/ms.js +86 -0
- data/vendor/moment/locale/mt.js +66 -0
- data/vendor/moment/locale/my.js +102 -0
- data/vendor/moment/locale/nb.js +72 -0
- data/vendor/moment/locale/ne.js +131 -0
- data/vendor/moment/locale/nl-be.js +113 -0
- data/vendor/moment/locale/nl.js +115 -0
- data/vendor/moment/locale/nn.js +71 -0
- data/vendor/moment/locale/oc-lnc.js +94 -0
- data/vendor/moment/locale/pa-in.js +132 -0
- data/vendor/moment/locale/pl.js +150 -0
- data/vendor/moment/locale/pt-br.js +68 -0
- data/vendor/moment/locale/pt.js +73 -0
- data/vendor/moment/locale/ro.js +86 -0
- data/vendor/moment/locale/ru.js +217 -0
- data/vendor/moment/locale/sd.js +92 -0
- data/vendor/moment/locale/se.js +68 -0
- data/vendor/moment/locale/si.js +79 -0
- data/vendor/moment/locale/sk.js +155 -0
- data/vendor/moment/locale/sl.js +181 -0
- data/vendor/moment/locale/sq.js +76 -0
- data/vendor/moment/locale/sr-cyrl.js +127 -0
- data/vendor/moment/locale/sr.js +129 -0
- data/vendor/moment/locale/ss.js +94 -0
- data/vendor/moment/locale/sv.js +79 -0
- data/vendor/moment/locale/sw.js +65 -0
- data/vendor/moment/locale/ta.js +140 -0
- data/vendor/moment/locale/te.js +97 -0
- data/vendor/moment/locale/tet.js +79 -0
- data/vendor/moment/locale/tg.js +127 -0
- data/vendor/moment/locale/th.js +75 -0
- data/vendor/moment/locale/tk.js +102 -0
- data/vendor/moment/locale/tl-ph.js +68 -0
- data/vendor/moment/locale/tlh.js +136 -0
- data/vendor/moment/locale/tr.js +117 -0
- data/vendor/moment/locale/tzl.js +100 -0
- data/vendor/moment/locale/tzm-latn.js +64 -0
- data/vendor/moment/locale/tzm.js +64 -0
- data/vendor/moment/locale/ug-cn.js +121 -0
- data/vendor/moment/locale/uk.js +174 -0
- data/vendor/moment/locale/ur.js +93 -0
- data/vendor/moment/locale/uz-latn.js +64 -0
- data/vendor/moment/locale/uz.js +62 -0
- data/vendor/moment/locale/vi.js +90 -0
- data/vendor/moment/locale/x-pseudo.js +82 -0
- data/vendor/moment/locale/yo.js +64 -0
- data/vendor/moment/locale/zh-cn.js +131 -0
- data/vendor/moment/locale/zh-hk.js +112 -0
- data/vendor/moment/locale/zh-mo.js +111 -0
- data/vendor/moment/locale/zh-tw.js +110 -0
- data/vendor/moment/meteor/README.md +5 -0
- data/vendor/moment/meteor/export.js +6 -0
- data/vendor/moment/meteor/moment.js +1 -0
- data/vendor/moment/meteor/package.js +27 -0
- data/vendor/moment/meteor/test.js +5 -0
- data/vendor/moment/min/locales.js +12384 -0
- data/vendor/moment/min/locales.min.js +2 -0
- data/vendor/moment/min/locales.min.js.map +1 -0
- data/vendor/moment/min/moment-with-locales.js +18039 -0
- data/vendor/moment/min/moment-with-locales.min.js +2 -0
- data/vendor/moment/min/moment-with-locales.min.js.map +1 -0
- data/vendor/moment/min/moment.min.js +2 -0
- data/vendor/moment/min/moment.min.js.map +1 -0
- data/vendor/moment/min/tests.js +146872 -0
- data/vendor/moment/moment.d.ts +796 -0
- data/vendor/moment/moment.js +5671 -0
- data/vendor/moment/package-lock.json +6460 -0
- data/vendor/moment/package.js +11 -0
- data/vendor/moment/package.json +112 -0
- data/vendor/moment/scripts/locales.js +146 -0
- data/vendor/moment/scripts/npm_prepublish.sh +49 -0
- data/vendor/moment/src/lib/create/check-overflow.js +57 -0
- data/vendor/moment/src/lib/create/date-from-array.js +35 -0
- data/vendor/moment/src/lib/create/from-anything.js +117 -0
- data/vendor/moment/src/lib/create/from-array.js +187 -0
- data/vendor/moment/src/lib/create/from-object.js +20 -0
- data/vendor/moment/src/lib/create/from-string-and-array.js +66 -0
- data/vendor/moment/src/lib/create/from-string-and-format.js +134 -0
- data/vendor/moment/src/lib/create/from-string.js +255 -0
- data/vendor/moment/src/lib/create/local.js +5 -0
- data/vendor/moment/src/lib/create/parsing-flags.js +28 -0
- data/vendor/moment/src/lib/create/utc.js +5 -0
- data/vendor/moment/src/lib/create/valid.js +51 -0
- data/vendor/moment/src/lib/duration/abs.js +18 -0
- data/vendor/moment/src/lib/duration/add-subtract.js +21 -0
- data/vendor/moment/src/lib/duration/as.js +88 -0
- data/vendor/moment/src/lib/duration/bubble.js +68 -0
- data/vendor/moment/src/lib/duration/clone.js +5 -0
- data/vendor/moment/src/lib/duration/constructor.js +42 -0
- data/vendor/moment/src/lib/duration/create.js +132 -0
- data/vendor/moment/src/lib/duration/duration.js +16 -0
- data/vendor/moment/src/lib/duration/get.js +27 -0
- data/vendor/moment/src/lib/duration/humanize.js +114 -0
- data/vendor/moment/src/lib/duration/iso-string.js +68 -0
- data/vendor/moment/src/lib/duration/prototype.js +78 -0
- data/vendor/moment/src/lib/duration/valid.js +54 -0
- data/vendor/moment/src/lib/format/format.js +103 -0
- data/vendor/moment/src/lib/locale/base-config.js +41 -0
- data/vendor/moment/src/lib/locale/calendar.js +15 -0
- data/vendor/moment/src/lib/locale/constructor.js +5 -0
- data/vendor/moment/src/lib/locale/en.js +39 -0
- data/vendor/moment/src/lib/locale/formats.js +36 -0
- data/vendor/moment/src/lib/locale/invalid.js +5 -0
- data/vendor/moment/src/lib/locale/lists.js +93 -0
- data/vendor/moment/src/lib/locale/locale.js +45 -0
- data/vendor/moment/src/lib/locale/locales.js +242 -0
- data/vendor/moment/src/lib/locale/ordinal.js +8 -0
- data/vendor/moment/src/lib/locale/pre-post-format.js +3 -0
- data/vendor/moment/src/lib/locale/prototype.js +88 -0
- data/vendor/moment/src/lib/locale/relative.js +32 -0
- data/vendor/moment/src/lib/locale/set.js +56 -0
- data/vendor/moment/src/lib/moment/add-subtract.js +61 -0
- data/vendor/moment/src/lib/moment/calendar.js +53 -0
- data/vendor/moment/src/lib/moment/clone.js +5 -0
- data/vendor/moment/src/lib/moment/compare.js +72 -0
- data/vendor/moment/src/lib/moment/constructor.js +77 -0
- data/vendor/moment/src/lib/moment/creation-data.js +9 -0
- data/vendor/moment/src/lib/moment/diff.js +79 -0
- data/vendor/moment/src/lib/moment/format.js +78 -0
- data/vendor/moment/src/lib/moment/from.js +20 -0
- data/vendor/moment/src/lib/moment/get-set.js +72 -0
- data/vendor/moment/src/lib/moment/locale.js +34 -0
- data/vendor/moment/src/lib/moment/min-max.js +62 -0
- data/vendor/moment/src/lib/moment/moment.js +28 -0
- data/vendor/moment/src/lib/moment/now.js +3 -0
- data/vendor/moment/src/lib/moment/prototype.js +197 -0
- data/vendor/moment/src/lib/moment/start-end-of.js +164 -0
- data/vendor/moment/src/lib/moment/to-type.js +42 -0
- data/vendor/moment/src/lib/moment/to.js +20 -0
- data/vendor/moment/src/lib/moment/valid.js +15 -0
- data/vendor/moment/src/lib/parse/regex.js +82 -0
- data/vendor/moment/src/lib/parse/token.js +34 -0
- data/vendor/moment/src/lib/units/aliases.js +31 -0
- data/vendor/moment/src/lib/units/constants.js +9 -0
- data/vendor/moment/src/lib/units/day-of-month.js +39 -0
- data/vendor/moment/src/lib/units/day-of-week.js +444 -0
- data/vendor/moment/src/lib/units/day-of-year.js +37 -0
- data/vendor/moment/src/lib/units/era.js +289 -0
- data/vendor/moment/src/lib/units/hour.js +159 -0
- data/vendor/moment/src/lib/units/millisecond.js +76 -0
- data/vendor/moment/src/lib/units/minute.js +29 -0
- data/vendor/moment/src/lib/units/month.js +349 -0
- data/vendor/moment/src/lib/units/offset.js +249 -0
- data/vendor/moment/src/lib/units/priorities.js +21 -0
- data/vendor/moment/src/lib/units/quarter.js +34 -0
- data/vendor/moment/src/lib/units/second.js +29 -0
- data/vendor/moment/src/lib/units/timestamp.js +20 -0
- data/vendor/moment/src/lib/units/timezone.js +16 -0
- data/vendor/moment/src/lib/units/units.js +20 -0
- data/vendor/moment/src/lib/units/week-calendar-utils.js +66 -0
- data/vendor/moment/src/lib/units/week-year.js +140 -0
- data/vendor/moment/src/lib/units/week.js +71 -0
- data/vendor/moment/src/lib/units/year.js +85 -0
- data/vendor/moment/src/lib/utils/abs-ceil.js +7 -0
- data/vendor/moment/src/lib/utils/abs-floor.js +8 -0
- data/vendor/moment/src/lib/utils/abs-round.js +7 -0
- data/vendor/moment/src/lib/utils/compare-arrays.js +18 -0
- data/vendor/moment/src/lib/utils/defaults.js +10 -0
- data/vendor/moment/src/lib/utils/deprecate.js +68 -0
- data/vendor/moment/src/lib/utils/extend.js +19 -0
- data/vendor/moment/src/lib/utils/has-own-prop.js +3 -0
- data/vendor/moment/src/lib/utils/hooks.js +13 -0
- data/vendor/moment/src/lib/utils/index-of.js +18 -0
- data/vendor/moment/src/lib/utils/is-array.js +6 -0
- data/vendor/moment/src/lib/utils/is-calendar-spec.js +25 -0
- data/vendor/moment/src/lib/utils/is-date.js +6 -0
- data/vendor/moment/src/lib/utils/is-function.js +6 -0
- data/vendor/moment/src/lib/utils/is-leap-year.js +3 -0
- data/vendor/moment/src/lib/utils/is-moment-input.js +74 -0
- data/vendor/moment/src/lib/utils/is-number.js +6 -0
- data/vendor/moment/src/lib/utils/is-object-empty.js +15 -0
- data/vendor/moment/src/lib/utils/is-object.js +8 -0
- data/vendor/moment/src/lib/utils/is-string.js +3 -0
- data/vendor/moment/src/lib/utils/is-undefined.js +3 -0
- data/vendor/moment/src/lib/utils/keys.js +20 -0
- data/vendor/moment/src/lib/utils/map.js +8 -0
- data/vendor/moment/src/lib/utils/mod.js +3 -0
- data/vendor/moment/src/lib/utils/some.js +20 -0
- data/vendor/moment/src/lib/utils/to-int.js +12 -0
- data/vendor/moment/src/lib/utils/zero-fill.js +10 -0
- data/vendor/moment/src/locale/af.js +71 -0
- data/vendor/moment/src/locale/ar-dz.js +156 -0
- data/vendor/moment/src/locale/ar-kw.js +54 -0
- data/vendor/moment/src/locale/ar-ly.js +171 -0
- data/vendor/moment/src/locale/ar-ma.js +55 -0
- data/vendor/moment/src/locale/ar-sa.js +104 -0
- data/vendor/moment/src/locale/ar-tn.js +54 -0
- data/vendor/moment/src/locale/ar.js +189 -0
- data/vendor/moment/src/locale/az.js +101 -0
- data/vendor/moment/src/locale/be.js +141 -0
- data/vendor/moment/src/locale/bg.js +87 -0
- data/vendor/moment/src/locale/bm.js +52 -0
- data/vendor/moment/src/locale/bn-bd.js +128 -0
- data/vendor/moment/src/locale/bn.js +118 -0
- data/vendor/moment/src/locale/bo.js +122 -0
- data/vendor/moment/src/locale/br.js +165 -0
- data/vendor/moment/src/locale/bs.js +149 -0
- data/vendor/moment/src/locale/ca.js +97 -0
- data/vendor/moment/src/locale/cs.js +171 -0
- data/vendor/moment/src/locale/cv.js +62 -0
- data/vendor/moment/src/locale/cy.js +97 -0
- data/vendor/moment/src/locale/da.js +53 -0
- data/vendor/moment/src/locale/de-at.js +79 -0
- data/vendor/moment/src/locale/de-ch.js +78 -0
- data/vendor/moment/src/locale/de.js +78 -0
- data/vendor/moment/src/locale/dv.js +90 -0
- data/vendor/moment/src/locale/el.js +104 -0
- data/vendor/moment/src/locale/en-au.js +68 -0
- data/vendor/moment/src/locale/en-ca.js +64 -0
- data/vendor/moment/src/locale/en-gb.js +68 -0
- data/vendor/moment/src/locale/en-ie.js +68 -0
- data/vendor/moment/src/locale/en-il.js +64 -0
- data/vendor/moment/src/locale/en-in.js +68 -0
- data/vendor/moment/src/locale/en-nz.js +68 -0
- data/vendor/moment/src/locale/en-sg.js +68 -0
- data/vendor/moment/src/locale/eo.js +68 -0
- data/vendor/moment/src/locale/es-do.js +104 -0
- data/vendor/moment/src/locale/es-mx.js +106 -0
- data/vendor/moment/src/locale/es-us.js +106 -0
- data/vendor/moment/src/locale/es.js +106 -0
- data/vendor/moment/src/locale/et.js +78 -0
- data/vendor/moment/src/locale/eu.js +63 -0
- data/vendor/moment/src/locale/fa.js +110 -0
- data/vendor/moment/src/locale/fi.js +121 -0
- data/vendor/moment/src/locale/fil.js +58 -0
- data/vendor/moment/src/locale/fo.js +56 -0
- data/vendor/moment/src/locale/fr-ca.js +69 -0
- data/vendor/moment/src/locale/fr-ch.js +73 -0
- data/vendor/moment/src/locale/fr.js +104 -0
- data/vendor/moment/src/locale/fy.js +77 -0
- data/vendor/moment/src/locale/ga.js +95 -0
- data/vendor/moment/src/locale/gd.js +95 -0
- data/vendor/moment/src/locale/gl.js +74 -0
- data/vendor/moment/src/locale/gom-deva.js +124 -0
- data/vendor/moment/src/locale/gom-latn.js +124 -0
- data/vendor/moment/src/locale/gu.js +121 -0
- data/vendor/moment/src/locale/he.js +94 -0
- data/vendor/moment/src/locale/hi.js +119 -0
- data/vendor/moment/src/locale/hr.js +154 -0
- data/vendor/moment/src/locale/hu.js +118 -0
- data/vendor/moment/src/locale/hy-am.js +92 -0
- data/vendor/moment/src/locale/id.js +76 -0
- data/vendor/moment/src/locale/is.js +139 -0
- data/vendor/moment/src/locale/it-ch.js +64 -0
- data/vendor/moment/src/locale/it.js +106 -0
- data/vendor/moment/src/locale/ja.js +148 -0
- data/vendor/moment/src/locale/jv.js +76 -0
- data/vendor/moment/src/locale/ka.js +92 -0
- data/vendor/moment/src/locale/kk.js +82 -0
- data/vendor/moment/src/locale/km.js +102 -0
- data/vendor/moment/src/locale/kn.js +123 -0
- data/vendor/moment/src/locale/ko.js +75 -0
- data/vendor/moment/src/locale/ku.js +118 -0
- data/vendor/moment/src/locale/ky.js +84 -0
- data/vendor/moment/src/locale/lb.js +135 -0
- data/vendor/moment/src/locale/lo.js +65 -0
- data/vendor/moment/src/locale/lt.js +123 -0
- data/vendor/moment/src/locale/lv.js +93 -0
- data/vendor/moment/src/locale/me.js +118 -0
- data/vendor/moment/src/locale/mi.js +59 -0
- data/vendor/moment/src/locale/mk.js +85 -0
- data/vendor/moment/src/locale/ml.js +80 -0
- data/vendor/moment/src/locale/mn.js +99 -0
- data/vendor/moment/src/locale/mr.js +202 -0
- data/vendor/moment/src/locale/ms-my.js +76 -0
- data/vendor/moment/src/locale/ms.js +75 -0
- data/vendor/moment/src/locale/mt.js +55 -0
- data/vendor/moment/src/locale/my.js +91 -0
- data/vendor/moment/src/locale/nb.js +61 -0
- data/vendor/moment/src/locale/ne.js +120 -0
- data/vendor/moment/src/locale/nl-be.js +102 -0
- data/vendor/moment/src/locale/nl.js +104 -0
- data/vendor/moment/src/locale/nn.js +60 -0
- data/vendor/moment/src/locale/oc-lnc.js +83 -0
- data/vendor/moment/src/locale/pa-in.js +121 -0
- data/vendor/moment/src/locale/pl.js +139 -0
- data/vendor/moment/src/locale/pt-br.js +57 -0
- data/vendor/moment/src/locale/pt.js +62 -0
- data/vendor/moment/src/locale/ro.js +75 -0
- data/vendor/moment/src/locale/ru.js +206 -0
- data/vendor/moment/src/locale/sd.js +81 -0
- data/vendor/moment/src/locale/se.js +57 -0
- data/vendor/moment/src/locale/si.js +68 -0
- data/vendor/moment/src/locale/sk.js +144 -0
- data/vendor/moment/src/locale/sl.js +170 -0
- data/vendor/moment/src/locale/sq.js +65 -0
- data/vendor/moment/src/locale/sr-cyrl.js +116 -0
- data/vendor/moment/src/locale/sr.js +118 -0
- data/vendor/moment/src/locale/ss.js +83 -0
- data/vendor/moment/src/locale/sv.js +68 -0
- data/vendor/moment/src/locale/sw.js +54 -0
- data/vendor/moment/src/locale/ta.js +129 -0
- data/vendor/moment/src/locale/te.js +86 -0
- data/vendor/moment/src/locale/tet.js +68 -0
- data/vendor/moment/src/locale/tg.js +116 -0
- data/vendor/moment/src/locale/th.js +64 -0
- data/vendor/moment/src/locale/tk.js +91 -0
- data/vendor/moment/src/locale/tl-ph.js +57 -0
- data/vendor/moment/src/locale/tlh.js +125 -0
- data/vendor/moment/src/locale/tr.js +106 -0
- data/vendor/moment/src/locale/tzl.js +89 -0
- data/vendor/moment/src/locale/tzm-latn.js +53 -0
- data/vendor/moment/src/locale/tzm.js +53 -0
- data/vendor/moment/src/locale/ug-cn.js +110 -0
- data/vendor/moment/src/locale/uk.js +163 -0
- data/vendor/moment/src/locale/ur.js +82 -0
- data/vendor/moment/src/locale/uz-latn.js +53 -0
- data/vendor/moment/src/locale/uz.js +51 -0
- data/vendor/moment/src/locale/vi.js +79 -0
- data/vendor/moment/src/locale/x-pseudo.js +71 -0
- data/vendor/moment/src/locale/yo.js +53 -0
- data/vendor/moment/src/locale/zh-cn.js +120 -0
- data/vendor/moment/src/locale/zh-hk.js +101 -0
- data/vendor/moment/src/locale/zh-mo.js +100 -0
- data/vendor/moment/src/locale/zh-tw.js +99 -0
- data/vendor/moment/src/moment.js +93 -0
- data/vendor/moment/src/test/helpers/common-locale.js +265 -0
- data/vendor/moment/src/test/helpers/deprecation-handler.js +62 -0
- data/vendor/moment/src/test/helpers/dst.js +8 -0
- data/vendor/moment/src/test/helpers/each-own-prop.js +8 -0
- data/vendor/moment/src/test/helpers/each.js +8 -0
- data/vendor/moment/src/test/helpers/has-own-prop.js +3 -0
- data/vendor/moment/src/test/helpers/object-keys.js +17 -0
- data/vendor/moment/src/test/locale/af.js +446 -0
- data/vendor/moment/src/test/locale/ar-dz.js +482 -0
- data/vendor/moment/src/test/locale/ar-kw.js +446 -0
- data/vendor/moment/src/test/locale/ar-ly.js +521 -0
- data/vendor/moment/src/test/locale/ar-ma.js +446 -0
- data/vendor/moment/src/test/locale/ar-sa.js +465 -0
- data/vendor/moment/src/test/locale/ar-tn.js +611 -0
- data/vendor/moment/src/test/locale/ar.js +521 -0
- data/vendor/moment/src/test/locale/az.js +453 -0
- data/vendor/moment/src/test/locale/be.js +575 -0
- data/vendor/moment/src/test/locale/bg.js +459 -0
- data/vendor/moment/src/test/locale/bm.js +408 -0
- data/vendor/moment/src/test/locale/bn-bd.js +473 -0
- data/vendor/moment/src/test/locale/bn.js +481 -0
- data/vendor/moment/src/test/locale/bo.js +501 -0
- data/vendor/moment/src/test/locale/br.js +541 -0
- data/vendor/moment/src/test/locale/bs.js +478 -0
- data/vendor/moment/src/test/locale/ca.js +472 -0
- data/vendor/moment/src/test/locale/cs.js +635 -0
- data/vendor/moment/src/test/locale/cv.js +459 -0
- data/vendor/moment/src/test/locale/cy.js +444 -0
- data/vendor/moment/src/test/locale/da.js +447 -0
- data/vendor/moment/src/test/locale/de-at.js +476 -0
- data/vendor/moment/src/test/locale/de-ch.js +481 -0
- data/vendor/moment/src/test/locale/de.js +480 -0
- data/vendor/moment/src/test/locale/dv.js +419 -0
- data/vendor/moment/src/test/locale/el.js +544 -0
- data/vendor/moment/src/test/locale/en-au.js +480 -0
- data/vendor/moment/src/test/locale/en-ca.js +451 -0
- data/vendor/moment/src/test/locale/en-gb.js +446 -0
- data/vendor/moment/src/test/locale/en-ie.js +446 -0
- data/vendor/moment/src/test/locale/en-il.js +454 -0
- data/vendor/moment/src/test/locale/en-in.js +464 -0
- data/vendor/moment/src/test/locale/en-nz.js +446 -0
- data/vendor/moment/src/test/locale/en-sg.js +430 -0
- data/vendor/moment/src/test/locale/en.js +562 -0
- data/vendor/moment/src/test/locale/eo.js +455 -0
- data/vendor/moment/src/test/locale/es-do.js +473 -0
- data/vendor/moment/src/test/locale/es-mx.js +514 -0
- data/vendor/moment/src/test/locale/es-us.js +489 -0
- data/vendor/moment/src/test/locale/es.js +476 -0
- data/vendor/moment/src/test/locale/et.js +533 -0
- data/vendor/moment/src/test/locale/eu.js +445 -0
- data/vendor/moment/src/test/locale/fa.js +461 -0
- data/vendor/moment/src/test/locale/fi.js +489 -0
- data/vendor/moment/src/test/locale/fil.js +448 -0
- data/vendor/moment/src/test/locale/fo.js +454 -0
- data/vendor/moment/src/test/locale/fr-ca.js +460 -0
- data/vendor/moment/src/test/locale/fr-ch.js +460 -0
- data/vendor/moment/src/test/locale/fr.js +482 -0
- data/vendor/moment/src/test/locale/fy.js +461 -0
- data/vendor/moment/src/test/locale/ga.js +445 -0
- data/vendor/moment/src/test/locale/gd.js +464 -0
- data/vendor/moment/src/test/locale/gl.js +466 -0
- data/vendor/moment/src/test/locale/gom-deva.js +445 -0
- data/vendor/moment/src/test/locale/gom-latn.js +459 -0
- data/vendor/moment/src/test/locale/gu.js +487 -0
- data/vendor/moment/src/test/locale/he.js +417 -0
- data/vendor/moment/src/test/locale/hi.js +484 -0
- data/vendor/moment/src/test/locale/hr.js +478 -0
- data/vendor/moment/src/test/locale/hu.js +468 -0
- data/vendor/moment/src/test/locale/hy-am.js +609 -0
- data/vendor/moment/src/test/locale/id.js +407 -0
- data/vendor/moment/src/test/locale/is.js +479 -0
- data/vendor/moment/src/test/locale/it-ch.js +427 -0
- data/vendor/moment/src/test/locale/it.js +479 -0
- data/vendor/moment/src/test/locale/ja.js +591 -0
- data/vendor/moment/src/test/locale/jv.js +418 -0
- data/vendor/moment/src/test/locale/ka.js +452 -0
- data/vendor/moment/src/test/locale/kk.js +445 -0
- data/vendor/moment/src/test/locale/km.js +471 -0
- data/vendor/moment/src/test/locale/kn.js +493 -0
- data/vendor/moment/src/test/locale/ko.js +496 -0
- data/vendor/moment/src/test/locale/ku.js +465 -0
- data/vendor/moment/src/test/locale/ky.js +445 -0
- data/vendor/moment/src/test/locale/lb.js +432 -0
- data/vendor/moment/src/test/locale/lo.js +445 -0
- data/vendor/moment/src/test/locale/lt.js +504 -0
- data/vendor/moment/src/test/locale/lv.js +567 -0
- data/vendor/moment/src/test/locale/me.js +481 -0
- data/vendor/moment/src/test/locale/mi.js +450 -0
- data/vendor/moment/src/test/locale/mk.js +460 -0
- data/vendor/moment/src/test/locale/ml.js +497 -0
- data/vendor/moment/src/test/locale/mn.js +555 -0
- data/vendor/moment/src/test/locale/mr.js +497 -0
- data/vendor/moment/src/test/locale/ms-my.js +454 -0
- data/vendor/moment/src/test/locale/ms.js +454 -0
- data/vendor/moment/src/test/locale/mt.js +446 -0
- data/vendor/moment/src/test/locale/my.js +616 -0
- data/vendor/moment/src/test/locale/nb.js +446 -0
- data/vendor/moment/src/test/locale/ne.js +484 -0
- data/vendor/moment/src/test/locale/nl-be.js +471 -0
- data/vendor/moment/src/test/locale/nl.js +471 -0
- data/vendor/moment/src/test/locale/nn.js +445 -0
- data/vendor/moment/src/test/locale/oc-lnc.js +440 -0
- data/vendor/moment/src/test/locale/pa-in.js +769 -0
- data/vendor/moment/src/test/locale/pl.js +557 -0
- data/vendor/moment/src/test/locale/pt-br.js +472 -0
- data/vendor/moment/src/test/locale/pt.js +449 -0
- data/vendor/moment/src/test/locale/ro.js +485 -0
- data/vendor/moment/src/test/locale/ru.js +706 -0
- data/vendor/moment/src/test/locale/sd.js +434 -0
- data/vendor/moment/src/test/locale/se.js +456 -0
- data/vendor/moment/src/test/locale/si.js +422 -0
- data/vendor/moment/src/test/locale/sk.js +640 -0
- data/vendor/moment/src/test/locale/sl.js +816 -0
- data/vendor/moment/src/test/locale/sq.js +457 -0
- data/vendor/moment/src/test/locale/sr-cyrl.js +478 -0
- data/vendor/moment/src/test/locale/sr.js +478 -0
- data/vendor/moment/src/test/locale/ss.js +510 -0
- data/vendor/moment/src/test/locale/sv.js +441 -0
- data/vendor/moment/src/test/locale/sw.js +449 -0
- data/vendor/moment/src/test/locale/ta.js +452 -0
- data/vendor/moment/src/test/locale/te.js +497 -0
- data/vendor/moment/src/test/locale/tet.js +446 -0
- data/vendor/moment/src/test/locale/tg.js +462 -0
- data/vendor/moment/src/test/locale/th.js +408 -0
- data/vendor/moment/src/test/locale/tk.js +445 -0
- data/vendor/moment/src/test/locale/tl-ph.js +448 -0
- data/vendor/moment/src/test/locale/tlh.js +484 -0
- data/vendor/moment/src/test/locale/tr.js +461 -0
- data/vendor/moment/src/test/locale/tzl.js +453 -0
- data/vendor/moment/src/test/locale/tzm-latn.js +449 -0
- data/vendor/moment/src/test/locale/tzm.js +449 -0
- data/vendor/moment/src/test/locale/ug-cn.js +427 -0
- data/vendor/moment/src/test/locale/uk.js +521 -0
- data/vendor/moment/src/test/locale/ur.js +439 -0
- data/vendor/moment/src/test/locale/uz-latn.js +450 -0
- data/vendor/moment/src/test/locale/uz.js +447 -0
- data/vendor/moment/src/test/locale/vi.js +452 -0
- data/vendor/moment/src/test/locale/x-pseudo.js +446 -0
- data/vendor/moment/src/test/locale/yo.js +447 -0
- data/vendor/moment/src/test/locale/zh-cn.js +459 -0
- data/vendor/moment/src/test/locale/zh-hk.js +443 -0
- data/vendor/moment/src/test/locale/zh-mo.js +427 -0
- data/vendor/moment/src/test/locale/zh-tw.js +443 -0
- data/vendor/moment/src/test/moment/add_subtract.js +545 -0
- data/vendor/moment/src/test/moment/calendar.js +214 -0
- data/vendor/moment/src/test/moment/create.js +2816 -0
- data/vendor/moment/src/test/moment/creation-data.js +40 -0
- data/vendor/moment/src/test/moment/days_in_month.js +122 -0
- data/vendor/moment/src/test/moment/days_in_year.js +11 -0
- data/vendor/moment/src/test/moment/deprecate.js +14 -0
- data/vendor/moment/src/test/moment/diff.js +624 -0
- data/vendor/moment/src/test/moment/duration.js +2024 -0
- data/vendor/moment/src/test/moment/duration_from_moments.js +53 -0
- data/vendor/moment/src/test/moment/duration_invalid.js +145 -0
- data/vendor/moment/src/test/moment/format.js +951 -0
- data/vendor/moment/src/test/moment/from_to.js +148 -0
- data/vendor/moment/src/test/moment/getters_setters.js +504 -0
- data/vendor/moment/src/test/moment/instanceof.js +42 -0
- data/vendor/moment/src/test/moment/invalid.js +212 -0
- data/vendor/moment/src/test/moment/is-leap-year.js +89 -0
- data/vendor/moment/src/test/moment/is_after.js +674 -0
- data/vendor/moment/src/test/moment/is_array.js +18 -0
- data/vendor/moment/src/test/moment/is_before.js +674 -0
- data/vendor/moment/src/test/moment/is_between.js +1082 -0
- data/vendor/moment/src/test/moment/is_date.js +32 -0
- data/vendor/moment/src/test/moment/is_moment.js +52 -0
- data/vendor/moment/src/test/moment/is_number.js +27 -0
- data/vendor/moment/src/test/moment/is_same.js +554 -0
- data/vendor/moment/src/test/moment/is_same_or_after.js +777 -0
- data/vendor/moment/src/test/moment/is_same_or_before.js +777 -0
- data/vendor/moment/src/test/moment/is_valid.js +563 -0
- data/vendor/moment/src/test/moment/leapyear.js +11 -0
- data/vendor/moment/src/test/moment/listers.js +172 -0
- data/vendor/moment/src/test/moment/locale.js +1029 -0
- data/vendor/moment/src/test/moment/locale_inheritance.js +332 -0
- data/vendor/moment/src/test/moment/locale_update.js +321 -0
- data/vendor/moment/src/test/moment/min_max.js +72 -0
- data/vendor/moment/src/test/moment/mutable.js +26 -0
- data/vendor/moment/src/test/moment/normalize_units.js +83 -0
- data/vendor/moment/src/test/moment/now.js +100 -0
- data/vendor/moment/src/test/moment/parsing_flags.js +434 -0
- data/vendor/moment/src/test/moment/preparse_postformat.js +121 -0
- data/vendor/moment/src/test/moment/quarter.js +117 -0
- data/vendor/moment/src/test/moment/relative_time.js +424 -0
- data/vendor/moment/src/test/moment/start_end_of.js +538 -0
- data/vendor/moment/src/test/moment/string_prototype.js +17 -0
- data/vendor/moment/src/test/moment/to_type.js +53 -0
- data/vendor/moment/src/test/moment/utc.js +138 -0
- data/vendor/moment/src/test/moment/utc_offset.js +894 -0
- data/vendor/moment/src/test/moment/week_year.js +1075 -0
- data/vendor/moment/src/test/moment/weekday.js +470 -0
- data/vendor/moment/src/test/moment/weeks.js +861 -0
- data/vendor/moment/src/test/moment/weeks_in_year.js +224 -0
- data/vendor/moment/src/test/moment/zone_switching.js +160 -0
- data/vendor/moment/src/test/moment/zones.js +840 -0
- data/vendor/moment/src/test/qunit-locale.js +32 -0
- data/vendor/moment/src/test/qunit.js +31 -0
- data/vendor/moment/tasks/bump_version.js +81 -0
- data/vendor/moment/tasks/check_sauce_creds.js +13 -0
- data/vendor/moment/tasks/component.js +13 -0
- data/vendor/moment/tasks/nuget.js +50 -0
- data/vendor/moment/tasks/qtest.js +56 -0
- data/vendor/moment/tasks/transpile.js +362 -0
- data/vendor/moment/tasks/update_index.js +32 -0
- data/vendor/moment/templates/default.js +5 -0
- data/vendor/moment/templates/empty.js +0 -0
- data/vendor/moment/templates/locale-header.js +6 -0
- data/vendor/moment/templates/test-header.js +6 -0
- data/vendor/moment/ts3.1-typing-tests/moment-tests.ts +547 -0
- data/vendor/moment/ts3.1-typing-tests/tsconfig.json +14 -0
- data/vendor/moment/ts3.1-typings/moment.d.ts +785 -0
- data/vendor/moment/typing-tests/moment-tests.ts +557 -0
- data/vendor/moment/typing-tests/tsconfig.json +12 -0
- data/vendor/tempusdominus/CONTRIBUTING.md +38 -0
- data/vendor/tempusdominus/Gruntfile.js +188 -0
- data/vendor/tempusdominus/LICENSE +21 -0
- data/vendor/tempusdominus/README.md +30 -0
- data/vendor/tempusdominus/build/css/tempusdominus-bootstrap-4.css +206 -0
- data/vendor/tempusdominus/build/css/tempusdominus-bootstrap-4.min.css +206 -0
- data/vendor/tempusdominus/build/js/tempusdominus-bootstrap-4.js +2779 -0
- data/vendor/tempusdominus/build/js/tempusdominus-bootstrap-4.min.js +7 -0
- data/vendor/tempusdominus/composer.json +29 -0
- data/vendor/tempusdominus/docs/Changelog/index.html +189 -0
- data/vendor/tempusdominus/docs/ContributorsGuide/index.html +290 -0
- data/vendor/tempusdominus/docs/Events/index.html +244 -0
- data/vendor/tempusdominus/docs/Extras/index.html +210 -0
- data/vendor/tempusdominus/docs/FAQ/index.html +186 -0
- data/vendor/tempusdominus/docs/Functions/index.html +239 -0
- data/vendor/tempusdominus/docs/Installing/index.html +233 -0
- data/vendor/tempusdominus/docs/Options/index.html +862 -0
- data/vendor/tempusdominus/docs/Usage/index.html +853 -0
- data/vendor/tempusdominus/docs/android-chrome-192x192.png +0 -0
- data/vendor/tempusdominus/docs/android-chrome-256x256.png +0 -0
- data/vendor/tempusdominus/docs/apple-touch-icon.png +0 -0
- data/vendor/tempusdominus/docs/browserconfig.xml +9 -0
- data/vendor/tempusdominus/docs/css/base.css +1705 -0
- data/vendor/tempusdominus/docs/css/tempusdominus-bootstrap-4.css +206 -0
- data/vendor/tempusdominus/docs/favicon-16x16.png +0 -0
- data/vendor/tempusdominus/docs/favicon-32x32.png +0 -0
- data/vendor/tempusdominus/docs/favicon.ico +0 -0
- data/vendor/tempusdominus/docs/index.html +208 -0
- data/vendor/tempusdominus/docs/js/base.js +62 -0
- data/vendor/tempusdominus/docs/js/tempusdominus-bootstrap-4.js +2779 -0
- data/vendor/tempusdominus/docs/manifest.json +18 -0
- data/vendor/tempusdominus/docs/mstile-150x150.png +0 -0
- data/vendor/tempusdominus/docs/safari-pinned-tab.svg +18 -0
- data/vendor/tempusdominus/docs/search/lunr.min.js +7 -0
- data/vendor/tempusdominus/docs/search/mustache.min.js +1 -0
- data/vendor/tempusdominus/docs/search/require.js +36 -0
- data/vendor/tempusdominus/docs/search/search-results-template.mustache +4 -0
- data/vendor/tempusdominus/docs/search/search.js +92 -0
- data/vendor/tempusdominus/docs/search/search_index.json +1084 -0
- data/vendor/tempusdominus/docs/search/text.js +390 -0
- data/vendor/tempusdominus/docs/sitemap.xml +84 -0
- data/vendor/tempusdominus/docs/theme/404.html +12 -0
- data/vendor/tempusdominus/docs/theme/android-chrome-192x192.png +0 -0
- data/vendor/tempusdominus/docs/theme/android-chrome-256x256.png +0 -0
- data/vendor/tempusdominus/docs/theme/apple-touch-icon.png +0 -0
- data/vendor/tempusdominus/docs/theme/base.html +105 -0
- data/vendor/tempusdominus/docs/theme/browserconfig.xml +9 -0
- data/vendor/tempusdominus/docs/theme/content.html +8 -0
- data/vendor/tempusdominus/docs/theme/css/base.css +1705 -0
- data/vendor/tempusdominus/docs/theme/css/tempusdominus-bootstrap-4.css +206 -0
- data/vendor/tempusdominus/docs/theme/favicon-16x16.png +0 -0
- data/vendor/tempusdominus/docs/theme/favicon-32x32.png +0 -0
- data/vendor/tempusdominus/docs/theme/favicon.ico +0 -0
- data/vendor/tempusdominus/docs/theme/js/base.js +62 -0
- data/vendor/tempusdominus/docs/theme/js/tempusdominus-bootstrap-4.js +2779 -0
- data/vendor/tempusdominus/docs/theme/main.html +1 -0
- data/vendor/tempusdominus/docs/theme/manifest.json +18 -0
- data/vendor/tempusdominus/docs/theme/mstile-150x150.png +0 -0
- data/vendor/tempusdominus/docs/theme/nav.html +32 -0
- data/vendor/tempusdominus/docs/theme/safari-pinned-tab.svg +18 -0
- data/vendor/tempusdominus/docs/theme/search-modal.html +24 -0
- data/vendor/tempusdominus/docs/theme/toc.html +13 -0
- data/vendor/tempusdominus/eslintrc.json +125 -0
- data/vendor/tempusdominus/mkdocs.yml +19 -0
- data/vendor/tempusdominus/package-lock.json +6426 -0
- data/vendor/tempusdominus/package.json +79 -0
- data/vendor/tempusdominus/src/docs/ChangeLog.md +20 -0
- data/vendor/tempusdominus/src/docs/ContributorsGuide.md +85 -0
- data/vendor/tempusdominus/src/docs/Events.md +95 -0
- data/vendor/tempusdominus/src/docs/Extras.md +49 -0
- data/vendor/tempusdominus/src/docs/FAQ.md +22 -0
- data/vendor/tempusdominus/src/docs/Functions.md +82 -0
- data/vendor/tempusdominus/src/docs/Installing.md +67 -0
- data/vendor/tempusdominus/src/docs/Options.md +940 -0
- data/vendor/tempusdominus/src/docs/Usage.md +724 -0
- data/vendor/tempusdominus/src/docs/index.md +53 -0
- data/vendor/tempusdominus/src/docs/theme/404.html +12 -0
- data/vendor/tempusdominus/src/docs/theme/android-chrome-192x192.png +0 -0
- data/vendor/tempusdominus/src/docs/theme/android-chrome-256x256.png +0 -0
- data/vendor/tempusdominus/src/docs/theme/apple-touch-icon.png +0 -0
- data/vendor/tempusdominus/src/docs/theme/base.html +105 -0
- data/vendor/tempusdominus/src/docs/theme/browserconfig.xml +9 -0
- data/vendor/tempusdominus/src/docs/theme/content.html +8 -0
- data/vendor/tempusdominus/src/docs/theme/css/base.css +1705 -0
- data/vendor/tempusdominus/src/docs/theme/css/tempusdominus-bootstrap-4.css +206 -0
- data/vendor/tempusdominus/src/docs/theme/favicon-16x16.png +0 -0
- data/vendor/tempusdominus/src/docs/theme/favicon-32x32.png +0 -0
- data/vendor/tempusdominus/src/docs/theme/favicon.ico +0 -0
- data/vendor/tempusdominus/src/docs/theme/js/base.js +62 -0
- data/vendor/tempusdominus/src/docs/theme/js/tempusdominus-bootstrap-4.js +2779 -0
- data/vendor/tempusdominus/src/docs/theme/main.html +1 -0
- data/vendor/tempusdominus/src/docs/theme/manifest.json +18 -0
- data/vendor/tempusdominus/src/docs/theme/mstile-150x150.png +0 -0
- data/vendor/tempusdominus/src/docs/theme/nav.html +32 -0
- data/vendor/tempusdominus/src/docs/theme/safari-pinned-tab.svg +18 -0
- data/vendor/tempusdominus/src/docs/theme/search-modal.html +24 -0
- data/vendor/tempusdominus/src/docs/theme/toc.html +13 -0
- data/vendor/tempusdominus/src/js/tempusdominus-bootstrap-4.js +1182 -0
- data/vendor/tempusdominus/src/sass/_tempusdominus-bootstrap-4.scss +342 -0
- data/vendor/tempusdominus/src/sass/tempusdominus-bootstrap-4-build.scss +17 -0
- data/vendor/tempusdominus/tasks/bump_version.js +75 -0
- metadata +882 -5
@@ -0,0 +1,2779 @@
|
|
1
|
+
/*@preserve
|
2
|
+
* Tempus Dominus Bootstrap4 v5.1.2 (https://tempusdominus.github.io/bootstrap-4/)
|
3
|
+
* Copyright 2016-2018 Jonathan Peterson
|
4
|
+
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
|
5
|
+
*/
|
6
|
+
|
7
|
+
if (typeof jQuery === 'undefined') {
|
8
|
+
throw new Error('Tempus Dominus Bootstrap4\'s requires jQuery. jQuery must be included before Tempus Dominus Bootstrap4\'s JavaScript.');
|
9
|
+
}
|
10
|
+
|
11
|
+
+function ($) {
|
12
|
+
var version = $.fn.jquery.split(' ')[0].split('.');
|
13
|
+
if ((version[0] < 2 && version[1] < 9) || (version[0] === 1 && version[1] === 9 && version[2] < 1) || (version[0] >= 4)) {
|
14
|
+
throw new Error('Tempus Dominus Bootstrap4\'s requires at least jQuery v3.0.0 but less than v4.0.0');
|
15
|
+
}
|
16
|
+
}(jQuery);
|
17
|
+
|
18
|
+
|
19
|
+
if (typeof moment === 'undefined') {
|
20
|
+
throw new Error('Tempus Dominus Bootstrap4\'s requires moment.js. Moment.js must be included before Tempus Dominus Bootstrap4\'s JavaScript.');
|
21
|
+
}
|
22
|
+
|
23
|
+
var version = moment.version.split('.')
|
24
|
+
if ((version[0] <= 2 && version[1] < 17) || (version[0] >= 3)) {
|
25
|
+
throw new Error('Tempus Dominus Bootstrap4\'s requires at least moment.js v2.17.0 but less than v3.0.0');
|
26
|
+
}
|
27
|
+
|
28
|
+
+function () {
|
29
|
+
|
30
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
31
|
+
|
32
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
33
|
+
|
34
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
35
|
+
|
36
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
37
|
+
|
38
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39
|
+
|
40
|
+
// ReSharper disable once InconsistentNaming
|
41
|
+
var DateTimePicker = function ($, moment) {
|
42
|
+
// ReSharper disable InconsistentNaming
|
43
|
+
var NAME = 'datetimepicker',
|
44
|
+
DATA_KEY = '' + NAME,
|
45
|
+
EVENT_KEY = '.' + DATA_KEY,
|
46
|
+
DATA_API_KEY = '.data-api',
|
47
|
+
Selector = {
|
48
|
+
DATA_TOGGLE: '[data-toggle="' + DATA_KEY + '"]'
|
49
|
+
},
|
50
|
+
ClassName = {
|
51
|
+
INPUT: NAME + '-input'
|
52
|
+
},
|
53
|
+
Event = {
|
54
|
+
CHANGE: 'change' + EVENT_KEY,
|
55
|
+
BLUR: 'blur' + EVENT_KEY,
|
56
|
+
KEYUP: 'keyup' + EVENT_KEY,
|
57
|
+
KEYDOWN: 'keydown' + EVENT_KEY,
|
58
|
+
FOCUS: 'focus' + EVENT_KEY,
|
59
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
|
60
|
+
//emitted
|
61
|
+
UPDATE: 'update' + EVENT_KEY,
|
62
|
+
ERROR: 'error' + EVENT_KEY,
|
63
|
+
HIDE: 'hide' + EVENT_KEY,
|
64
|
+
SHOW: 'show' + EVENT_KEY
|
65
|
+
},
|
66
|
+
DatePickerModes = [{
|
67
|
+
CLASS_NAME: 'days',
|
68
|
+
NAV_FUNCTION: 'M',
|
69
|
+
NAV_STEP: 1
|
70
|
+
}, {
|
71
|
+
CLASS_NAME: 'months',
|
72
|
+
NAV_FUNCTION: 'y',
|
73
|
+
NAV_STEP: 1
|
74
|
+
}, {
|
75
|
+
CLASS_NAME: 'years',
|
76
|
+
NAV_FUNCTION: 'y',
|
77
|
+
NAV_STEP: 10
|
78
|
+
}, {
|
79
|
+
CLASS_NAME: 'decades',
|
80
|
+
NAV_FUNCTION: 'y',
|
81
|
+
NAV_STEP: 100
|
82
|
+
}],
|
83
|
+
KeyMap = {
|
84
|
+
'up': 38,
|
85
|
+
38: 'up',
|
86
|
+
'down': 40,
|
87
|
+
40: 'down',
|
88
|
+
'left': 37,
|
89
|
+
37: 'left',
|
90
|
+
'right': 39,
|
91
|
+
39: 'right',
|
92
|
+
'tab': 9,
|
93
|
+
9: 'tab',
|
94
|
+
'escape': 27,
|
95
|
+
27: 'escape',
|
96
|
+
'enter': 13,
|
97
|
+
13: 'enter',
|
98
|
+
'pageUp': 33,
|
99
|
+
33: 'pageUp',
|
100
|
+
'pageDown': 34,
|
101
|
+
34: 'pageDown',
|
102
|
+
'shift': 16,
|
103
|
+
16: 'shift',
|
104
|
+
'control': 17,
|
105
|
+
17: 'control',
|
106
|
+
'space': 32,
|
107
|
+
32: 'space',
|
108
|
+
't': 84,
|
109
|
+
84: 't',
|
110
|
+
'delete': 46,
|
111
|
+
46: 'delete'
|
112
|
+
},
|
113
|
+
ViewModes = ['times', 'days', 'months', 'years', 'decades'],
|
114
|
+
keyState = {},
|
115
|
+
keyPressHandled = {};
|
116
|
+
|
117
|
+
var Default = {
|
118
|
+
timeZone: '',
|
119
|
+
format: false,
|
120
|
+
dayViewHeaderFormat: 'MMMM YYYY',
|
121
|
+
extraFormats: false,
|
122
|
+
stepping: 1,
|
123
|
+
minDate: false,
|
124
|
+
maxDate: false,
|
125
|
+
useCurrent: true,
|
126
|
+
collapse: true,
|
127
|
+
locale: moment.locale(),
|
128
|
+
defaultDate: false,
|
129
|
+
disabledDates: false,
|
130
|
+
enabledDates: false,
|
131
|
+
icons: {
|
132
|
+
time: 'fa fa-clock-o',
|
133
|
+
date: 'fa fa-calendar',
|
134
|
+
up: 'fa fa-arrow-up',
|
135
|
+
down: 'fa fa-arrow-down',
|
136
|
+
previous: 'fa fa-chevron-left',
|
137
|
+
next: 'fa fa-chevron-right',
|
138
|
+
today: 'fa fa-calendar-check-o',
|
139
|
+
clear: 'fa fa-delete',
|
140
|
+
close: 'fa fa-times'
|
141
|
+
},
|
142
|
+
tooltips: {
|
143
|
+
today: 'Go to today',
|
144
|
+
clear: 'Clear selection',
|
145
|
+
close: 'Close the picker',
|
146
|
+
selectMonth: 'Select Month',
|
147
|
+
prevMonth: 'Previous Month',
|
148
|
+
nextMonth: 'Next Month',
|
149
|
+
selectYear: 'Select Year',
|
150
|
+
prevYear: 'Previous Year',
|
151
|
+
nextYear: 'Next Year',
|
152
|
+
selectDecade: 'Select Decade',
|
153
|
+
prevDecade: 'Previous Decade',
|
154
|
+
nextDecade: 'Next Decade',
|
155
|
+
prevCentury: 'Previous Century',
|
156
|
+
nextCentury: 'Next Century',
|
157
|
+
pickHour: 'Pick Hour',
|
158
|
+
incrementHour: 'Increment Hour',
|
159
|
+
decrementHour: 'Decrement Hour',
|
160
|
+
pickMinute: 'Pick Minute',
|
161
|
+
incrementMinute: 'Increment Minute',
|
162
|
+
decrementMinute: 'Decrement Minute',
|
163
|
+
pickSecond: 'Pick Second',
|
164
|
+
incrementSecond: 'Increment Second',
|
165
|
+
decrementSecond: 'Decrement Second',
|
166
|
+
togglePeriod: 'Toggle Period',
|
167
|
+
selectTime: 'Select Time',
|
168
|
+
selectDate: 'Select Date'
|
169
|
+
},
|
170
|
+
useStrict: false,
|
171
|
+
sideBySide: false,
|
172
|
+
daysOfWeekDisabled: false,
|
173
|
+
calendarWeeks: false,
|
174
|
+
viewMode: 'days',
|
175
|
+
toolbarPlacement: 'default',
|
176
|
+
buttons: {
|
177
|
+
showToday: false,
|
178
|
+
showClear: false,
|
179
|
+
showClose: false
|
180
|
+
},
|
181
|
+
widgetPositioning: {
|
182
|
+
horizontal: 'auto',
|
183
|
+
vertical: 'auto'
|
184
|
+
},
|
185
|
+
widgetParent: null,
|
186
|
+
ignoreReadonly: false,
|
187
|
+
keepOpen: false,
|
188
|
+
focusOnShow: true,
|
189
|
+
inline: false,
|
190
|
+
keepInvalid: false,
|
191
|
+
keyBinds: {
|
192
|
+
up: function up() {
|
193
|
+
if (!this.widget) {
|
194
|
+
return false;
|
195
|
+
}
|
196
|
+
var d = this._dates[0] || this.getMoment();
|
197
|
+
if (this.widget.find('.datepicker').is(':visible')) {
|
198
|
+
this.date(d.clone().subtract(7, 'd'));
|
199
|
+
} else {
|
200
|
+
this.date(d.clone().add(this.stepping(), 'm'));
|
201
|
+
}
|
202
|
+
return true;
|
203
|
+
},
|
204
|
+
down: function down() {
|
205
|
+
if (!this.widget) {
|
206
|
+
this.show();
|
207
|
+
return false;
|
208
|
+
}
|
209
|
+
var d = this._dates[0] || this.getMoment();
|
210
|
+
if (this.widget.find('.datepicker').is(':visible')) {
|
211
|
+
this.date(d.clone().add(7, 'd'));
|
212
|
+
} else {
|
213
|
+
this.date(d.clone().subtract(this.stepping(), 'm'));
|
214
|
+
}
|
215
|
+
return true;
|
216
|
+
},
|
217
|
+
'control up': function controlUp() {
|
218
|
+
if (!this.widget) {
|
219
|
+
return false;
|
220
|
+
}
|
221
|
+
var d = this._dates[0] || this.getMoment();
|
222
|
+
if (this.widget.find('.datepicker').is(':visible')) {
|
223
|
+
this.date(d.clone().subtract(1, 'y'));
|
224
|
+
} else {
|
225
|
+
this.date(d.clone().add(1, 'h'));
|
226
|
+
}
|
227
|
+
return true;
|
228
|
+
},
|
229
|
+
'control down': function controlDown() {
|
230
|
+
if (!this.widget) {
|
231
|
+
return false;
|
232
|
+
}
|
233
|
+
var d = this._dates[0] || this.getMoment();
|
234
|
+
if (this.widget.find('.datepicker').is(':visible')) {
|
235
|
+
this.date(d.clone().add(1, 'y'));
|
236
|
+
} else {
|
237
|
+
this.date(d.clone().subtract(1, 'h'));
|
238
|
+
}
|
239
|
+
return true;
|
240
|
+
},
|
241
|
+
left: function left() {
|
242
|
+
if (!this.widget) {
|
243
|
+
return false;
|
244
|
+
}
|
245
|
+
var d = this._dates[0] || this.getMoment();
|
246
|
+
if (this.widget.find('.datepicker').is(':visible')) {
|
247
|
+
this.date(d.clone().subtract(1, 'd'));
|
248
|
+
}
|
249
|
+
return true;
|
250
|
+
},
|
251
|
+
right: function right() {
|
252
|
+
if (!this.widget) {
|
253
|
+
return false;
|
254
|
+
}
|
255
|
+
var d = this._dates[0] || this.getMoment();
|
256
|
+
if (this.widget.find('.datepicker').is(':visible')) {
|
257
|
+
this.date(d.clone().add(1, 'd'));
|
258
|
+
}
|
259
|
+
return true;
|
260
|
+
},
|
261
|
+
pageUp: function pageUp() {
|
262
|
+
if (!this.widget) {
|
263
|
+
return false;
|
264
|
+
}
|
265
|
+
var d = this._dates[0] || this.getMoment();
|
266
|
+
if (this.widget.find('.datepicker').is(':visible')) {
|
267
|
+
this.date(d.clone().subtract(1, 'M'));
|
268
|
+
}
|
269
|
+
return true;
|
270
|
+
},
|
271
|
+
pageDown: function pageDown() {
|
272
|
+
if (!this.widget) {
|
273
|
+
return false;
|
274
|
+
}
|
275
|
+
var d = this._dates[0] || this.getMoment();
|
276
|
+
if (this.widget.find('.datepicker').is(':visible')) {
|
277
|
+
this.date(d.clone().add(1, 'M'));
|
278
|
+
}
|
279
|
+
return true;
|
280
|
+
},
|
281
|
+
enter: function enter() {
|
282
|
+
if (!this.widget) {
|
283
|
+
return false;
|
284
|
+
}
|
285
|
+
this.hide();
|
286
|
+
return true;
|
287
|
+
},
|
288
|
+
escape: function escape() {
|
289
|
+
if (!this.widget) {
|
290
|
+
return false;
|
291
|
+
}
|
292
|
+
this.hide();
|
293
|
+
return true;
|
294
|
+
},
|
295
|
+
'control space': function controlSpace() {
|
296
|
+
if (!this.widget) {
|
297
|
+
return false;
|
298
|
+
}
|
299
|
+
if (this.widget.find('.timepicker').is(':visible')) {
|
300
|
+
this.widget.find('.btn[data-action="togglePeriod"]').click();
|
301
|
+
}
|
302
|
+
return true;
|
303
|
+
},
|
304
|
+
t: function t() {
|
305
|
+
if (!this.widget) {
|
306
|
+
return false;
|
307
|
+
}
|
308
|
+
this.date(this.getMoment());
|
309
|
+
return true;
|
310
|
+
},
|
311
|
+
'delete': function _delete() {
|
312
|
+
if (!this.widget) {
|
313
|
+
return false;
|
314
|
+
}
|
315
|
+
this.clear();
|
316
|
+
return true;
|
317
|
+
}
|
318
|
+
},
|
319
|
+
debug: false,
|
320
|
+
allowInputToggle: false,
|
321
|
+
disabledTimeIntervals: false,
|
322
|
+
disabledHours: false,
|
323
|
+
enabledHours: false,
|
324
|
+
viewDate: false,
|
325
|
+
allowMultidate: false,
|
326
|
+
multidateSeparator: ','
|
327
|
+
};
|
328
|
+
|
329
|
+
// ReSharper restore InconsistentNaming
|
330
|
+
|
331
|
+
// ReSharper disable once DeclarationHides
|
332
|
+
// ReSharper disable once InconsistentNaming
|
333
|
+
|
334
|
+
var DateTimePicker = function () {
|
335
|
+
/** @namespace eData.dateOptions */
|
336
|
+
/** @namespace moment.tz */
|
337
|
+
|
338
|
+
function DateTimePicker(element, options) {
|
339
|
+
_classCallCheck(this, DateTimePicker);
|
340
|
+
|
341
|
+
this._options = this._getOptions(options);
|
342
|
+
this._element = element;
|
343
|
+
this._dates = [];
|
344
|
+
this._datesFormatted = [];
|
345
|
+
this._viewDate = null;
|
346
|
+
this.unset = true;
|
347
|
+
this.component = false;
|
348
|
+
this.widget = false;
|
349
|
+
this.use24Hours = null;
|
350
|
+
this.actualFormat = null;
|
351
|
+
this.parseFormats = null;
|
352
|
+
this.currentViewMode = null;
|
353
|
+
this.MinViewModeNumber = 0;
|
354
|
+
|
355
|
+
this._int();
|
356
|
+
}
|
357
|
+
|
358
|
+
/**
|
359
|
+
* @return {string}
|
360
|
+
*/
|
361
|
+
|
362
|
+
|
363
|
+
//private
|
364
|
+
|
365
|
+
DateTimePicker.prototype._int = function _int() {
|
366
|
+
var targetInput = this._element.data('target-input');
|
367
|
+
if (this._element.is('input')) {
|
368
|
+
this.input = this._element;
|
369
|
+
} else if (targetInput !== undefined) {
|
370
|
+
if (targetInput === 'nearest') {
|
371
|
+
this.input = this._element.find('input');
|
372
|
+
} else {
|
373
|
+
this.input = $(targetInput);
|
374
|
+
}
|
375
|
+
}
|
376
|
+
|
377
|
+
this._dates = [];
|
378
|
+
this._dates[0] = this.getMoment();
|
379
|
+
this._viewDate = this.getMoment().clone();
|
380
|
+
|
381
|
+
$.extend(true, this._options, this._dataToOptions());
|
382
|
+
|
383
|
+
this.options(this._options);
|
384
|
+
|
385
|
+
this._initFormatting();
|
386
|
+
|
387
|
+
if (this.input !== undefined && this.input.is('input') && this.input.val().trim().length !== 0) {
|
388
|
+
this._setValue(this._parseInputDate(this.input.val().trim()), 0);
|
389
|
+
} else if (this._options.defaultDate && this.input !== undefined && this.input.attr('placeholder') === undefined) {
|
390
|
+
this._setValue(this._options.defaultDate, 0);
|
391
|
+
}
|
392
|
+
if (this._options.inline) {
|
393
|
+
this.show();
|
394
|
+
}
|
395
|
+
};
|
396
|
+
|
397
|
+
DateTimePicker.prototype._update = function _update() {
|
398
|
+
if (!this.widget) {
|
399
|
+
return;
|
400
|
+
}
|
401
|
+
this._fillDate();
|
402
|
+
this._fillTime();
|
403
|
+
};
|
404
|
+
|
405
|
+
DateTimePicker.prototype._setValue = function _setValue(targetMoment, index) {
|
406
|
+
var oldDate = this.unset ? null : this._dates[index];
|
407
|
+
var outpValue = '';
|
408
|
+
// case of calling setValue(null or false)
|
409
|
+
if (!targetMoment) {
|
410
|
+
if (!this._options.allowMultidate || this._dates.length === 1) {
|
411
|
+
this.unset = true;
|
412
|
+
this._dates = [];
|
413
|
+
this._datesFormatted = [];
|
414
|
+
} else {
|
415
|
+
outpValue = this._element.data('date') + ',';
|
416
|
+
outpValue = outpValue.replace(oldDate.format(this.actualFormat) + ',', '').replace(',,', '').replace(/,\s*$/, '');
|
417
|
+
this._dates.splice(index, 1);
|
418
|
+
this._datesFormatted.splice(index, 1);
|
419
|
+
}
|
420
|
+
if (this.input !== undefined) {
|
421
|
+
this.input.val(outpValue);
|
422
|
+
this.input.trigger('input');
|
423
|
+
}
|
424
|
+
this._element.data('date', outpValue);
|
425
|
+
this._notifyEvent({
|
426
|
+
type: DateTimePicker.Event.CHANGE,
|
427
|
+
date: false,
|
428
|
+
oldDate: oldDate
|
429
|
+
});
|
430
|
+
this._update();
|
431
|
+
return;
|
432
|
+
}
|
433
|
+
|
434
|
+
targetMoment = targetMoment.clone().locale(this._options.locale);
|
435
|
+
|
436
|
+
if (this._hasTimeZone()) {
|
437
|
+
targetMoment.tz(this._options.timeZone);
|
438
|
+
}
|
439
|
+
|
440
|
+
if (this._options.stepping !== 1) {
|
441
|
+
targetMoment.minutes(Math.round(targetMoment.minutes() / this._options.stepping) * this._options.stepping).seconds(0);
|
442
|
+
}
|
443
|
+
|
444
|
+
if (this._isValid(targetMoment)) {
|
445
|
+
this._dates[index] = targetMoment;
|
446
|
+
this._datesFormatted[index] = targetMoment.format('YYYY-MM-DD');
|
447
|
+
this._viewDate = targetMoment.clone();
|
448
|
+
if (this._options.allowMultidate && this._dates.length > 1) {
|
449
|
+
for (var i = 0; i < this._dates.length; i++) {
|
450
|
+
outpValue += '' + this._dates[i].format(this.actualFormat) + this._options.multidateSeparator;
|
451
|
+
}
|
452
|
+
outpValue = outpValue.replace(/,\s*$/, '');
|
453
|
+
} else {
|
454
|
+
outpValue = this._dates[index].format(this.actualFormat);
|
455
|
+
}
|
456
|
+
if (this.input !== undefined) {
|
457
|
+
this.input.val(outpValue);
|
458
|
+
this.input.trigger('input');
|
459
|
+
}
|
460
|
+
this._element.data('date', outpValue);
|
461
|
+
|
462
|
+
this.unset = false;
|
463
|
+
this._update();
|
464
|
+
this._notifyEvent({
|
465
|
+
type: DateTimePicker.Event.CHANGE,
|
466
|
+
date: this._dates[index].clone(),
|
467
|
+
oldDate: oldDate
|
468
|
+
});
|
469
|
+
} else {
|
470
|
+
if (!this._options.keepInvalid) {
|
471
|
+
if (this.input !== undefined) {
|
472
|
+
this.input.val('' + (this.unset ? '' : this._dates[index].format(this.actualFormat)));
|
473
|
+
this.input.trigger('input');
|
474
|
+
}
|
475
|
+
} else {
|
476
|
+
this._notifyEvent({
|
477
|
+
type: DateTimePicker.Event.CHANGE,
|
478
|
+
date: targetMoment,
|
479
|
+
oldDate: oldDate
|
480
|
+
});
|
481
|
+
}
|
482
|
+
this._notifyEvent({
|
483
|
+
type: DateTimePicker.Event.ERROR,
|
484
|
+
date: targetMoment,
|
485
|
+
oldDate: oldDate
|
486
|
+
});
|
487
|
+
}
|
488
|
+
};
|
489
|
+
|
490
|
+
DateTimePicker.prototype._change = function _change(e) {
|
491
|
+
var val = $(e.target).val().trim(),
|
492
|
+
parsedDate = val ? this._parseInputDate(val) : null;
|
493
|
+
this._setValue(parsedDate);
|
494
|
+
e.stopImmediatePropagation();
|
495
|
+
return false;
|
496
|
+
};
|
497
|
+
|
498
|
+
//noinspection JSMethodCanBeStatic
|
499
|
+
|
500
|
+
|
501
|
+
DateTimePicker.prototype._getOptions = function _getOptions(options) {
|
502
|
+
options = $.extend(true, {}, Default, options);
|
503
|
+
return options;
|
504
|
+
};
|
505
|
+
|
506
|
+
DateTimePicker.prototype._hasTimeZone = function _hasTimeZone() {
|
507
|
+
return moment.tz !== undefined && this._options.timeZone !== undefined && this._options.timeZone !== null && this._options.timeZone !== '';
|
508
|
+
};
|
509
|
+
|
510
|
+
DateTimePicker.prototype._isEnabled = function _isEnabled(granularity) {
|
511
|
+
if (typeof granularity !== 'string' || granularity.length > 1) {
|
512
|
+
throw new TypeError('isEnabled expects a single character string parameter');
|
513
|
+
}
|
514
|
+
switch (granularity) {
|
515
|
+
case 'y':
|
516
|
+
return this.actualFormat.indexOf('Y') !== -1;
|
517
|
+
case 'M':
|
518
|
+
return this.actualFormat.indexOf('M') !== -1;
|
519
|
+
case 'd':
|
520
|
+
return this.actualFormat.toLowerCase().indexOf('d') !== -1;
|
521
|
+
case 'h':
|
522
|
+
case 'H':
|
523
|
+
return this.actualFormat.toLowerCase().indexOf('h') !== -1;
|
524
|
+
case 'm':
|
525
|
+
return this.actualFormat.indexOf('m') !== -1;
|
526
|
+
case 's':
|
527
|
+
return this.actualFormat.indexOf('s') !== -1;
|
528
|
+
case 'a':
|
529
|
+
case 'A':
|
530
|
+
return this.actualFormat.toLowerCase().indexOf('a') !== -1;
|
531
|
+
default:
|
532
|
+
return false;
|
533
|
+
}
|
534
|
+
};
|
535
|
+
|
536
|
+
DateTimePicker.prototype._hasTime = function _hasTime() {
|
537
|
+
return this._isEnabled('h') || this._isEnabled('m') || this._isEnabled('s');
|
538
|
+
};
|
539
|
+
|
540
|
+
DateTimePicker.prototype._hasDate = function _hasDate() {
|
541
|
+
return this._isEnabled('y') || this._isEnabled('M') || this._isEnabled('d');
|
542
|
+
};
|
543
|
+
|
544
|
+
DateTimePicker.prototype._dataToOptions = function _dataToOptions() {
|
545
|
+
var eData = this._element.data();
|
546
|
+
var dataOptions = {};
|
547
|
+
|
548
|
+
if (eData.dateOptions && eData.dateOptions instanceof Object) {
|
549
|
+
dataOptions = $.extend(true, dataOptions, eData.dateOptions);
|
550
|
+
}
|
551
|
+
|
552
|
+
$.each(this._options, function (key) {
|
553
|
+
var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1); //todo data api key
|
554
|
+
if (eData[attributeName] !== undefined) {
|
555
|
+
dataOptions[key] = eData[attributeName];
|
556
|
+
} else {
|
557
|
+
delete dataOptions[key];
|
558
|
+
}
|
559
|
+
});
|
560
|
+
return dataOptions;
|
561
|
+
};
|
562
|
+
|
563
|
+
DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) {
|
564
|
+
if (e.type === DateTimePicker.Event.CHANGE && (e.date && e.date.isSame(e.oldDate)) || !e.date && !e.oldDate) {
|
565
|
+
return;
|
566
|
+
}
|
567
|
+
this._element.trigger(e);
|
568
|
+
};
|
569
|
+
|
570
|
+
DateTimePicker.prototype._viewUpdate = function _viewUpdate(e) {
|
571
|
+
if (e === 'y') {
|
572
|
+
e = 'YYYY';
|
573
|
+
}
|
574
|
+
this._notifyEvent({
|
575
|
+
type: DateTimePicker.Event.UPDATE,
|
576
|
+
change: e,
|
577
|
+
viewDate: this._viewDate.clone()
|
578
|
+
});
|
579
|
+
};
|
580
|
+
|
581
|
+
DateTimePicker.prototype._showMode = function _showMode(dir) {
|
582
|
+
if (!this.widget) {
|
583
|
+
return;
|
584
|
+
}
|
585
|
+
if (dir) {
|
586
|
+
this.currentViewMode = Math.max(this.MinViewModeNumber, Math.min(3, this.currentViewMode + dir));
|
587
|
+
}
|
588
|
+
this.widget.find('.datepicker > div').hide().filter('.datepicker-' + DatePickerModes[this.currentViewMode].CLASS_NAME).show();
|
589
|
+
};
|
590
|
+
|
591
|
+
DateTimePicker.prototype._isInDisabledDates = function _isInDisabledDates(testDate) {
|
592
|
+
return this._options.disabledDates[testDate.format('YYYY-MM-DD')] === true;
|
593
|
+
};
|
594
|
+
|
595
|
+
DateTimePicker.prototype._isInEnabledDates = function _isInEnabledDates(testDate) {
|
596
|
+
return this._options.enabledDates[testDate.format('YYYY-MM-DD')] === true;
|
597
|
+
};
|
598
|
+
|
599
|
+
DateTimePicker.prototype._isInDisabledHours = function _isInDisabledHours(testDate) {
|
600
|
+
return this._options.disabledHours[testDate.format('H')] === true;
|
601
|
+
};
|
602
|
+
|
603
|
+
DateTimePicker.prototype._isInEnabledHours = function _isInEnabledHours(testDate) {
|
604
|
+
return this._options.enabledHours[testDate.format('H')] === true;
|
605
|
+
};
|
606
|
+
|
607
|
+
DateTimePicker.prototype._isValid = function _isValid(targetMoment, granularity) {
|
608
|
+
if (!targetMoment.isValid()) {
|
609
|
+
return false;
|
610
|
+
}
|
611
|
+
if (this._options.disabledDates && granularity === 'd' && this._isInDisabledDates(targetMoment)) {
|
612
|
+
return false;
|
613
|
+
}
|
614
|
+
if (this._options.enabledDates && granularity === 'd' && !this._isInEnabledDates(targetMoment)) {
|
615
|
+
return false;
|
616
|
+
}
|
617
|
+
if (this._options.minDate && targetMoment.isBefore(this._options.minDate, granularity)) {
|
618
|
+
return false;
|
619
|
+
}
|
620
|
+
if (this._options.maxDate && targetMoment.isAfter(this._options.maxDate, granularity)) {
|
621
|
+
return false;
|
622
|
+
}
|
623
|
+
if (this._options.daysOfWeekDisabled && granularity === 'd' && this._options.daysOfWeekDisabled.indexOf(targetMoment.day()) !== -1) {
|
624
|
+
return false;
|
625
|
+
}
|
626
|
+
if (this._options.disabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && this._isInDisabledHours(targetMoment)) {
|
627
|
+
return false;
|
628
|
+
}
|
629
|
+
if (this._options.enabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && !this._isInEnabledHours(targetMoment)) {
|
630
|
+
return false;
|
631
|
+
}
|
632
|
+
if (this._options.disabledTimeIntervals && (granularity === 'h' || granularity === 'm' || granularity === 's')) {
|
633
|
+
var found = false;
|
634
|
+
$.each(this._options.disabledTimeIntervals, function () {
|
635
|
+
if (targetMoment.isBetween(this[0], this[1])) {
|
636
|
+
found = true;
|
637
|
+
return false;
|
638
|
+
}
|
639
|
+
});
|
640
|
+
if (found) {
|
641
|
+
return false;
|
642
|
+
}
|
643
|
+
}
|
644
|
+
return true;
|
645
|
+
};
|
646
|
+
|
647
|
+
DateTimePicker.prototype._parseInputDate = function _parseInputDate(inputDate) {
|
648
|
+
if (this._options.parseInputDate === undefined) {
|
649
|
+
if (!moment.isMoment(inputDate)) {
|
650
|
+
inputDate = this.getMoment(inputDate);
|
651
|
+
}
|
652
|
+
} else {
|
653
|
+
inputDate = this._options.parseInputDate(inputDate);
|
654
|
+
}
|
655
|
+
//inputDate.locale(this.options.locale);
|
656
|
+
return inputDate;
|
657
|
+
};
|
658
|
+
|
659
|
+
DateTimePicker.prototype._keydown = function _keydown(e) {
|
660
|
+
var handler = null,
|
661
|
+
index = void 0,
|
662
|
+
index2 = void 0,
|
663
|
+
keyBindKeys = void 0,
|
664
|
+
allModifiersPressed = void 0;
|
665
|
+
var pressedKeys = [],
|
666
|
+
pressedModifiers = {},
|
667
|
+
currentKey = e.which,
|
668
|
+
pressed = 'p';
|
669
|
+
|
670
|
+
keyState[currentKey] = pressed;
|
671
|
+
|
672
|
+
for (index in keyState) {
|
673
|
+
if (keyState.hasOwnProperty(index) && keyState[index] === pressed) {
|
674
|
+
pressedKeys.push(index);
|
675
|
+
if (parseInt(index, 10) !== currentKey) {
|
676
|
+
pressedModifiers[index] = true;
|
677
|
+
}
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
for (index in this._options.keyBinds) {
|
682
|
+
if (this._options.keyBinds.hasOwnProperty(index) && typeof this._options.keyBinds[index] === 'function') {
|
683
|
+
keyBindKeys = index.split(' ');
|
684
|
+
if (keyBindKeys.length === pressedKeys.length && KeyMap[currentKey] === keyBindKeys[keyBindKeys.length - 1]) {
|
685
|
+
allModifiersPressed = true;
|
686
|
+
for (index2 = keyBindKeys.length - 2; index2 >= 0; index2--) {
|
687
|
+
if (!(KeyMap[keyBindKeys[index2]] in pressedModifiers)) {
|
688
|
+
allModifiersPressed = false;
|
689
|
+
break;
|
690
|
+
}
|
691
|
+
}
|
692
|
+
if (allModifiersPressed) {
|
693
|
+
handler = this._options.keyBinds[index];
|
694
|
+
break;
|
695
|
+
}
|
696
|
+
}
|
697
|
+
}
|
698
|
+
}
|
699
|
+
|
700
|
+
if (handler) {
|
701
|
+
if (handler.call(this)) {
|
702
|
+
e.stopPropagation();
|
703
|
+
e.preventDefault();
|
704
|
+
}
|
705
|
+
}
|
706
|
+
};
|
707
|
+
|
708
|
+
//noinspection JSMethodCanBeStatic,SpellCheckingInspection
|
709
|
+
|
710
|
+
|
711
|
+
DateTimePicker.prototype._keyup = function _keyup(e) {
|
712
|
+
keyState[e.which] = 'r';
|
713
|
+
if (keyPressHandled[e.which]) {
|
714
|
+
keyPressHandled[e.which] = false;
|
715
|
+
e.stopPropagation();
|
716
|
+
e.preventDefault();
|
717
|
+
}
|
718
|
+
};
|
719
|
+
|
720
|
+
DateTimePicker.prototype._indexGivenDates = function _indexGivenDates(givenDatesArray) {
|
721
|
+
// Store given enabledDates and disabledDates as keys.
|
722
|
+
// This way we can check their existence in O(1) time instead of looping through whole array.
|
723
|
+
// (for example: options.enabledDates['2014-02-27'] === true)
|
724
|
+
var givenDatesIndexed = {},
|
725
|
+
self = this;
|
726
|
+
$.each(givenDatesArray, function () {
|
727
|
+
var dDate = self._parseInputDate(this);
|
728
|
+
if (dDate.isValid()) {
|
729
|
+
givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true;
|
730
|
+
}
|
731
|
+
});
|
732
|
+
return Object.keys(givenDatesIndexed).length ? givenDatesIndexed : false;
|
733
|
+
};
|
734
|
+
|
735
|
+
DateTimePicker.prototype._indexGivenHours = function _indexGivenHours(givenHoursArray) {
|
736
|
+
// Store given enabledHours and disabledHours as keys.
|
737
|
+
// This way we can check their existence in O(1) time instead of looping through whole array.
|
738
|
+
// (for example: options.enabledHours['2014-02-27'] === true)
|
739
|
+
var givenHoursIndexed = {};
|
740
|
+
$.each(givenHoursArray, function () {
|
741
|
+
givenHoursIndexed[this] = true;
|
742
|
+
});
|
743
|
+
return Object.keys(givenHoursIndexed).length ? givenHoursIndexed : false;
|
744
|
+
};
|
745
|
+
|
746
|
+
DateTimePicker.prototype._initFormatting = function _initFormatting() {
|
747
|
+
var format = this._options.format || 'L LT',
|
748
|
+
self = this;
|
749
|
+
|
750
|
+
this.actualFormat = format.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) {
|
751
|
+
return self._dates[0].localeData().longDateFormat(formatInput) || formatInput; //todo taking the first date should be ok
|
752
|
+
});
|
753
|
+
|
754
|
+
this.parseFormats = this._options.extraFormats ? this._options.extraFormats.slice() : [];
|
755
|
+
if (this.parseFormats.indexOf(format) < 0 && this.parseFormats.indexOf(this.actualFormat) < 0) {
|
756
|
+
this.parseFormats.push(this.actualFormat);
|
757
|
+
}
|
758
|
+
|
759
|
+
this.use24Hours = this.actualFormat.toLowerCase().indexOf('a') < 1 && this.actualFormat.replace(/\[.*?]/g, '').indexOf('h') < 1;
|
760
|
+
|
761
|
+
if (this._isEnabled('y')) {
|
762
|
+
this.MinViewModeNumber = 2;
|
763
|
+
}
|
764
|
+
if (this._isEnabled('M')) {
|
765
|
+
this.MinViewModeNumber = 1;
|
766
|
+
}
|
767
|
+
if (this._isEnabled('d')) {
|
768
|
+
this.MinViewModeNumber = 0;
|
769
|
+
}
|
770
|
+
|
771
|
+
this.currentViewMode = Math.max(this.MinViewModeNumber, this.currentViewMode);
|
772
|
+
|
773
|
+
if (!this.unset) {
|
774
|
+
this._setValue(this._dates[0], 0);
|
775
|
+
}
|
776
|
+
};
|
777
|
+
|
778
|
+
DateTimePicker.prototype._getLastPickedDate = function _getLastPickedDate() {
|
779
|
+
return this._dates[this._getLastPickedDateIndex()];
|
780
|
+
};
|
781
|
+
|
782
|
+
DateTimePicker.prototype._getLastPickedDateIndex = function _getLastPickedDateIndex() {
|
783
|
+
return this._dates.length - 1;
|
784
|
+
};
|
785
|
+
|
786
|
+
//public
|
787
|
+
|
788
|
+
|
789
|
+
DateTimePicker.prototype.getMoment = function getMoment(d) {
|
790
|
+
var returnMoment = void 0;
|
791
|
+
|
792
|
+
if (d === undefined || d === null) {
|
793
|
+
returnMoment = moment(); //TODO should this use format? and locale?
|
794
|
+
} else if (this._hasTimeZone()) {
|
795
|
+
// There is a string to parse and a default time zone
|
796
|
+
// parse with the tz function which takes a default time zone if it is not in the format string
|
797
|
+
returnMoment = moment.tz(d, this.parseFormats, this._options.locale, this._options.useStrict, this._options.timeZone);
|
798
|
+
} else {
|
799
|
+
returnMoment = moment(d, this.parseFormats, this._options.locale, this._options.useStrict);
|
800
|
+
}
|
801
|
+
|
802
|
+
if (this._hasTimeZone()) {
|
803
|
+
returnMoment.tz(this._options.timeZone);
|
804
|
+
}
|
805
|
+
|
806
|
+
return returnMoment;
|
807
|
+
};
|
808
|
+
|
809
|
+
DateTimePicker.prototype.toggle = function toggle() {
|
810
|
+
return this.widget ? this.hide() : this.show();
|
811
|
+
};
|
812
|
+
|
813
|
+
DateTimePicker.prototype.ignoreReadonly = function ignoreReadonly(_ignoreReadonly) {
|
814
|
+
if (arguments.length === 0) {
|
815
|
+
return this._options.ignoreReadonly;
|
816
|
+
}
|
817
|
+
if (typeof _ignoreReadonly !== 'boolean') {
|
818
|
+
throw new TypeError('ignoreReadonly () expects a boolean parameter');
|
819
|
+
}
|
820
|
+
this._options.ignoreReadonly = _ignoreReadonly;
|
821
|
+
};
|
822
|
+
|
823
|
+
DateTimePicker.prototype.options = function options(newOptions) {
|
824
|
+
if (arguments.length === 0) {
|
825
|
+
return $.extend(true, {}, this._options);
|
826
|
+
}
|
827
|
+
|
828
|
+
if (!(newOptions instanceof Object)) {
|
829
|
+
throw new TypeError('options() this.options parameter should be an object');
|
830
|
+
}
|
831
|
+
$.extend(true, this._options, newOptions);
|
832
|
+
var self = this;
|
833
|
+
$.each(this._options, function (key, value) {
|
834
|
+
if (self[key] !== undefined) {
|
835
|
+
self[key](value);
|
836
|
+
}
|
837
|
+
});
|
838
|
+
};
|
839
|
+
|
840
|
+
DateTimePicker.prototype.date = function date(newDate, index) {
|
841
|
+
index = index || 0;
|
842
|
+
if (arguments.length === 0) {
|
843
|
+
if (this.unset) {
|
844
|
+
return null;
|
845
|
+
}
|
846
|
+
if (this._options.allowMultidate) {
|
847
|
+
return this._dates.join(this._options.multidateSeparator);
|
848
|
+
} else {
|
849
|
+
return this._dates[index].clone();
|
850
|
+
}
|
851
|
+
}
|
852
|
+
|
853
|
+
if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
|
854
|
+
throw new TypeError('date() parameter must be one of [null, string, moment or Date]');
|
855
|
+
}
|
856
|
+
|
857
|
+
this._setValue(newDate === null ? null : this._parseInputDate(newDate), index);
|
858
|
+
};
|
859
|
+
|
860
|
+
DateTimePicker.prototype.format = function format(newFormat) {
|
861
|
+
if (arguments.length === 0) {
|
862
|
+
return this._options.format;
|
863
|
+
}
|
864
|
+
|
865
|
+
if (typeof newFormat !== 'string' && (typeof newFormat !== 'boolean' || newFormat !== false)) {
|
866
|
+
throw new TypeError('format() expects a string or boolean:false parameter ' + newFormat);
|
867
|
+
}
|
868
|
+
|
869
|
+
this._options.format = newFormat;
|
870
|
+
if (this.actualFormat) {
|
871
|
+
this._initFormatting(); // reinitialize formatting
|
872
|
+
}
|
873
|
+
};
|
874
|
+
|
875
|
+
DateTimePicker.prototype.timeZone = function timeZone(newZone) {
|
876
|
+
if (arguments.length === 0) {
|
877
|
+
return this._options.timeZone;
|
878
|
+
}
|
879
|
+
|
880
|
+
if (typeof newZone !== 'string') {
|
881
|
+
throw new TypeError('newZone() expects a string parameter');
|
882
|
+
}
|
883
|
+
|
884
|
+
this._options.timeZone = newZone;
|
885
|
+
};
|
886
|
+
|
887
|
+
DateTimePicker.prototype.dayViewHeaderFormat = function dayViewHeaderFormat(newFormat) {
|
888
|
+
if (arguments.length === 0) {
|
889
|
+
return this._options.dayViewHeaderFormat;
|
890
|
+
}
|
891
|
+
|
892
|
+
if (typeof newFormat !== 'string') {
|
893
|
+
throw new TypeError('dayViewHeaderFormat() expects a string parameter');
|
894
|
+
}
|
895
|
+
|
896
|
+
this._options.dayViewHeaderFormat = newFormat;
|
897
|
+
};
|
898
|
+
|
899
|
+
DateTimePicker.prototype.extraFormats = function extraFormats(formats) {
|
900
|
+
if (arguments.length === 0) {
|
901
|
+
return this._options.extraFormats;
|
902
|
+
}
|
903
|
+
|
904
|
+
if (formats !== false && !(formats instanceof Array)) {
|
905
|
+
throw new TypeError('extraFormats() expects an array or false parameter');
|
906
|
+
}
|
907
|
+
|
908
|
+
this._options.extraFormats = formats;
|
909
|
+
if (this.parseFormats) {
|
910
|
+
this._initFormatting(); // reinit formatting
|
911
|
+
}
|
912
|
+
};
|
913
|
+
|
914
|
+
DateTimePicker.prototype.disabledDates = function disabledDates(dates) {
|
915
|
+
if (arguments.length === 0) {
|
916
|
+
return this._options.disabledDates ? $.extend({}, this._options.disabledDates) : this._options.disabledDates;
|
917
|
+
}
|
918
|
+
|
919
|
+
if (!dates) {
|
920
|
+
this._options.disabledDates = false;
|
921
|
+
this._update();
|
922
|
+
return true;
|
923
|
+
}
|
924
|
+
if (!(dates instanceof Array)) {
|
925
|
+
throw new TypeError('disabledDates() expects an array parameter');
|
926
|
+
}
|
927
|
+
this._options.disabledDates = this._indexGivenDates(dates);
|
928
|
+
this._options.enabledDates = false;
|
929
|
+
this._update();
|
930
|
+
};
|
931
|
+
|
932
|
+
DateTimePicker.prototype.enabledDates = function enabledDates(dates) {
|
933
|
+
if (arguments.length === 0) {
|
934
|
+
return this._options.enabledDates ? $.extend({}, this._options.enabledDates) : this._options.enabledDates;
|
935
|
+
}
|
936
|
+
|
937
|
+
if (!dates) {
|
938
|
+
this._options.enabledDates = false;
|
939
|
+
this._update();
|
940
|
+
return true;
|
941
|
+
}
|
942
|
+
if (!(dates instanceof Array)) {
|
943
|
+
throw new TypeError('enabledDates() expects an array parameter');
|
944
|
+
}
|
945
|
+
this._options.enabledDates = this._indexGivenDates(dates);
|
946
|
+
this._options.disabledDates = false;
|
947
|
+
this._update();
|
948
|
+
};
|
949
|
+
|
950
|
+
DateTimePicker.prototype.daysOfWeekDisabled = function daysOfWeekDisabled(_daysOfWeekDisabled) {
|
951
|
+
if (arguments.length === 0) {
|
952
|
+
return this._options.daysOfWeekDisabled.splice(0);
|
953
|
+
}
|
954
|
+
|
955
|
+
if (typeof _daysOfWeekDisabled === 'boolean' && !_daysOfWeekDisabled) {
|
956
|
+
this._options.daysOfWeekDisabled = false;
|
957
|
+
this._update();
|
958
|
+
return true;
|
959
|
+
}
|
960
|
+
|
961
|
+
if (!(_daysOfWeekDisabled instanceof Array)) {
|
962
|
+
throw new TypeError('daysOfWeekDisabled() expects an array parameter');
|
963
|
+
}
|
964
|
+
this._options.daysOfWeekDisabled = _daysOfWeekDisabled.reduce(function (previousValue, currentValue) {
|
965
|
+
currentValue = parseInt(currentValue, 10);
|
966
|
+
if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) {
|
967
|
+
return previousValue;
|
968
|
+
}
|
969
|
+
if (previousValue.indexOf(currentValue) === -1) {
|
970
|
+
previousValue.push(currentValue);
|
971
|
+
}
|
972
|
+
return previousValue;
|
973
|
+
}, []).sort();
|
974
|
+
if (this._options.useCurrent && !this._options.keepInvalid) {
|
975
|
+
for (var i = 0; i < this._dates.length; i++) {
|
976
|
+
var tries = 0;
|
977
|
+
while (!this._isValid(this._dates[i], 'd')) {
|
978
|
+
this._dates[i].add(1, 'd');
|
979
|
+
if (tries === 31) {
|
980
|
+
throw 'Tried 31 times to find a valid date';
|
981
|
+
}
|
982
|
+
tries++;
|
983
|
+
}
|
984
|
+
this._setValue(this._dates[i], i);
|
985
|
+
}
|
986
|
+
}
|
987
|
+
this._update();
|
988
|
+
};
|
989
|
+
|
990
|
+
DateTimePicker.prototype.maxDate = function maxDate(_maxDate) {
|
991
|
+
if (arguments.length === 0) {
|
992
|
+
return this._options.maxDate ? this._options.maxDate.clone() : this._options.maxDate;
|
993
|
+
}
|
994
|
+
|
995
|
+
if (typeof _maxDate === 'boolean' && _maxDate === false) {
|
996
|
+
this._options.maxDate = false;
|
997
|
+
this._update();
|
998
|
+
return true;
|
999
|
+
}
|
1000
|
+
|
1001
|
+
if (typeof _maxDate === 'string') {
|
1002
|
+
if (_maxDate === 'now' || _maxDate === 'moment') {
|
1003
|
+
_maxDate = this.getMoment();
|
1004
|
+
}
|
1005
|
+
}
|
1006
|
+
|
1007
|
+
var parsedDate = this._parseInputDate(_maxDate);
|
1008
|
+
|
1009
|
+
if (!parsedDate.isValid()) {
|
1010
|
+
throw new TypeError('maxDate() Could not parse date parameter: ' + _maxDate);
|
1011
|
+
}
|
1012
|
+
if (this._options.minDate && parsedDate.isBefore(this._options.minDate)) {
|
1013
|
+
throw new TypeError('maxDate() date parameter is before this.options.minDate: ' + parsedDate.format(this.actualFormat));
|
1014
|
+
}
|
1015
|
+
this._options.maxDate = parsedDate;
|
1016
|
+
for (var i = 0; i < this._dates.length; i++) {
|
1017
|
+
if (this._options.useCurrent && !this._options.keepInvalid && this._dates[i].isAfter(_maxDate)) {
|
1018
|
+
this._setValue(this._options.maxDate, i);
|
1019
|
+
}
|
1020
|
+
}
|
1021
|
+
if (this._viewDate.isAfter(parsedDate)) {
|
1022
|
+
this._viewDate = parsedDate.clone().subtract(this._options.stepping, 'm');
|
1023
|
+
}
|
1024
|
+
this._update();
|
1025
|
+
};
|
1026
|
+
|
1027
|
+
DateTimePicker.prototype.minDate = function minDate(_minDate) {
|
1028
|
+
if (arguments.length === 0) {
|
1029
|
+
return this._options.minDate ? this._options.minDate.clone() : this._options.minDate;
|
1030
|
+
}
|
1031
|
+
|
1032
|
+
if (typeof _minDate === 'boolean' && _minDate === false) {
|
1033
|
+
this._options.minDate = false;
|
1034
|
+
this._update();
|
1035
|
+
return true;
|
1036
|
+
}
|
1037
|
+
|
1038
|
+
if (typeof _minDate === 'string') {
|
1039
|
+
if (_minDate === 'now' || _minDate === 'moment') {
|
1040
|
+
_minDate = this.getMoment();
|
1041
|
+
}
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
var parsedDate = this._parseInputDate(_minDate);
|
1045
|
+
|
1046
|
+
if (!parsedDate.isValid()) {
|
1047
|
+
throw new TypeError('minDate() Could not parse date parameter: ' + _minDate);
|
1048
|
+
}
|
1049
|
+
if (this._options.maxDate && parsedDate.isAfter(this._options.maxDate)) {
|
1050
|
+
throw new TypeError('minDate() date parameter is after this.options.maxDate: ' + parsedDate.format(this.actualFormat));
|
1051
|
+
}
|
1052
|
+
this._options.minDate = parsedDate;
|
1053
|
+
for (var i = 0; i < this._dates.length; i++) {
|
1054
|
+
if (this._options.useCurrent && !this._options.keepInvalid && this._dates[i].isBefore(_minDate)) {
|
1055
|
+
this._setValue(this._options.minDate, i);
|
1056
|
+
}
|
1057
|
+
}
|
1058
|
+
if (this._viewDate.isBefore(parsedDate)) {
|
1059
|
+
this._viewDate = parsedDate.clone().add(this._options.stepping, 'm');
|
1060
|
+
}
|
1061
|
+
this._update();
|
1062
|
+
};
|
1063
|
+
|
1064
|
+
DateTimePicker.prototype.defaultDate = function defaultDate(_defaultDate) {
|
1065
|
+
if (arguments.length === 0) {
|
1066
|
+
return this._options.defaultDate ? this._options.defaultDate.clone() : this._options.defaultDate;
|
1067
|
+
}
|
1068
|
+
if (!_defaultDate) {
|
1069
|
+
this._options.defaultDate = false;
|
1070
|
+
return true;
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
if (typeof _defaultDate === 'string') {
|
1074
|
+
if (_defaultDate === 'now' || _defaultDate === 'moment') {
|
1075
|
+
_defaultDate = this.getMoment();
|
1076
|
+
} else {
|
1077
|
+
_defaultDate = this.getMoment(_defaultDate);
|
1078
|
+
}
|
1079
|
+
}
|
1080
|
+
|
1081
|
+
var parsedDate = this._parseInputDate(_defaultDate);
|
1082
|
+
if (!parsedDate.isValid()) {
|
1083
|
+
throw new TypeError('defaultDate() Could not parse date parameter: ' + _defaultDate);
|
1084
|
+
}
|
1085
|
+
if (!this._isValid(parsedDate)) {
|
1086
|
+
throw new TypeError('defaultDate() date passed is invalid according to component setup validations');
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
this._options.defaultDate = parsedDate;
|
1090
|
+
|
1091
|
+
if (this._options.defaultDate && this._options.inline || this.input !== undefined && this.input.val().trim() === '') {
|
1092
|
+
this._setValue(this._options.defaultDate, 0);
|
1093
|
+
}
|
1094
|
+
};
|
1095
|
+
|
1096
|
+
DateTimePicker.prototype.locale = function locale(_locale) {
|
1097
|
+
if (arguments.length === 0) {
|
1098
|
+
return this._options.locale;
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
if (!moment.localeData(_locale)) {
|
1102
|
+
throw new TypeError('locale() locale ' + _locale + ' is not loaded from moment locales!');
|
1103
|
+
}
|
1104
|
+
|
1105
|
+
this._options.locale = _locale;
|
1106
|
+
|
1107
|
+
for (var i = 0; i < this._dates.length; i++) {
|
1108
|
+
this._dates[i].locale(this._options.locale);
|
1109
|
+
}
|
1110
|
+
this._viewDate.locale(this._options.locale);
|
1111
|
+
|
1112
|
+
if (this.actualFormat) {
|
1113
|
+
this._initFormatting(); // reinitialize formatting
|
1114
|
+
}
|
1115
|
+
if (this.widget) {
|
1116
|
+
this.hide();
|
1117
|
+
this.show();
|
1118
|
+
}
|
1119
|
+
};
|
1120
|
+
|
1121
|
+
DateTimePicker.prototype.stepping = function stepping(_stepping) {
|
1122
|
+
if (arguments.length === 0) {
|
1123
|
+
return this._options.stepping;
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
_stepping = parseInt(_stepping, 10);
|
1127
|
+
if (isNaN(_stepping) || _stepping < 1) {
|
1128
|
+
_stepping = 1;
|
1129
|
+
}
|
1130
|
+
this._options.stepping = _stepping;
|
1131
|
+
};
|
1132
|
+
|
1133
|
+
DateTimePicker.prototype.useCurrent = function useCurrent(_useCurrent) {
|
1134
|
+
var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute'];
|
1135
|
+
if (arguments.length === 0) {
|
1136
|
+
return this._options.useCurrent;
|
1137
|
+
}
|
1138
|
+
|
1139
|
+
if (typeof _useCurrent !== 'boolean' && typeof _useCurrent !== 'string') {
|
1140
|
+
throw new TypeError('useCurrent() expects a boolean or string parameter');
|
1141
|
+
}
|
1142
|
+
if (typeof _useCurrent === 'string' && useCurrentOptions.indexOf(_useCurrent.toLowerCase()) === -1) {
|
1143
|
+
throw new TypeError('useCurrent() expects a string parameter of ' + useCurrentOptions.join(', '));
|
1144
|
+
}
|
1145
|
+
this._options.useCurrent = _useCurrent;
|
1146
|
+
};
|
1147
|
+
|
1148
|
+
DateTimePicker.prototype.collapse = function collapse(_collapse) {
|
1149
|
+
if (arguments.length === 0) {
|
1150
|
+
return this._options.collapse;
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
if (typeof _collapse !== 'boolean') {
|
1154
|
+
throw new TypeError('collapse() expects a boolean parameter');
|
1155
|
+
}
|
1156
|
+
if (this._options.collapse === _collapse) {
|
1157
|
+
return true;
|
1158
|
+
}
|
1159
|
+
this._options.collapse = _collapse;
|
1160
|
+
if (this.widget) {
|
1161
|
+
this.hide();
|
1162
|
+
this.show();
|
1163
|
+
}
|
1164
|
+
};
|
1165
|
+
|
1166
|
+
DateTimePicker.prototype.icons = function icons(_icons) {
|
1167
|
+
if (arguments.length === 0) {
|
1168
|
+
return $.extend({}, this._options.icons);
|
1169
|
+
}
|
1170
|
+
|
1171
|
+
if (!(_icons instanceof Object)) {
|
1172
|
+
throw new TypeError('icons() expects parameter to be an Object');
|
1173
|
+
}
|
1174
|
+
|
1175
|
+
$.extend(this._options.icons, _icons);
|
1176
|
+
|
1177
|
+
if (this.widget) {
|
1178
|
+
this.hide();
|
1179
|
+
this.show();
|
1180
|
+
}
|
1181
|
+
};
|
1182
|
+
|
1183
|
+
DateTimePicker.prototype.tooltips = function tooltips(_tooltips) {
|
1184
|
+
if (arguments.length === 0) {
|
1185
|
+
return $.extend({}, this._options.tooltips);
|
1186
|
+
}
|
1187
|
+
|
1188
|
+
if (!(_tooltips instanceof Object)) {
|
1189
|
+
throw new TypeError('tooltips() expects parameter to be an Object');
|
1190
|
+
}
|
1191
|
+
$.extend(this._options.tooltips, _tooltips);
|
1192
|
+
if (this.widget) {
|
1193
|
+
this.hide();
|
1194
|
+
this.show();
|
1195
|
+
}
|
1196
|
+
};
|
1197
|
+
|
1198
|
+
DateTimePicker.prototype.useStrict = function useStrict(_useStrict) {
|
1199
|
+
if (arguments.length === 0) {
|
1200
|
+
return this._options.useStrict;
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
if (typeof _useStrict !== 'boolean') {
|
1204
|
+
throw new TypeError('useStrict() expects a boolean parameter');
|
1205
|
+
}
|
1206
|
+
this._options.useStrict = _useStrict;
|
1207
|
+
};
|
1208
|
+
|
1209
|
+
DateTimePicker.prototype.sideBySide = function sideBySide(_sideBySide) {
|
1210
|
+
if (arguments.length === 0) {
|
1211
|
+
return this._options.sideBySide;
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
if (typeof _sideBySide !== 'boolean') {
|
1215
|
+
throw new TypeError('sideBySide() expects a boolean parameter');
|
1216
|
+
}
|
1217
|
+
this._options.sideBySide = _sideBySide;
|
1218
|
+
if (this.widget) {
|
1219
|
+
this.hide();
|
1220
|
+
this.show();
|
1221
|
+
}
|
1222
|
+
};
|
1223
|
+
|
1224
|
+
DateTimePicker.prototype.viewMode = function viewMode(_viewMode) {
|
1225
|
+
if (arguments.length === 0) {
|
1226
|
+
return this._options.viewMode;
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
if (typeof _viewMode !== 'string') {
|
1230
|
+
throw new TypeError('viewMode() expects a string parameter');
|
1231
|
+
}
|
1232
|
+
|
1233
|
+
if (DateTimePicker.ViewModes.indexOf(_viewMode) === -1) {
|
1234
|
+
throw new TypeError('viewMode() parameter must be one of (' + DateTimePicker.ViewModes.join(', ') + ') value');
|
1235
|
+
}
|
1236
|
+
|
1237
|
+
this._options.viewMode = _viewMode;
|
1238
|
+
this.currentViewMode = Math.max(DateTimePicker.ViewModes.indexOf(_viewMode) - 1, this.MinViewModeNumber);
|
1239
|
+
|
1240
|
+
this._showMode();
|
1241
|
+
};
|
1242
|
+
|
1243
|
+
DateTimePicker.prototype.calendarWeeks = function calendarWeeks(_calendarWeeks) {
|
1244
|
+
if (arguments.length === 0) {
|
1245
|
+
return this._options.calendarWeeks;
|
1246
|
+
}
|
1247
|
+
|
1248
|
+
if (typeof _calendarWeeks !== 'boolean') {
|
1249
|
+
throw new TypeError('calendarWeeks() expects parameter to be a boolean value');
|
1250
|
+
}
|
1251
|
+
|
1252
|
+
this._options.calendarWeeks = _calendarWeeks;
|
1253
|
+
this._update();
|
1254
|
+
};
|
1255
|
+
|
1256
|
+
DateTimePicker.prototype.buttons = function buttons(_buttons) {
|
1257
|
+
if (arguments.length === 0) {
|
1258
|
+
return $.extend({}, this._options.buttons);
|
1259
|
+
}
|
1260
|
+
|
1261
|
+
if (!(_buttons instanceof Object)) {
|
1262
|
+
throw new TypeError('buttons() expects parameter to be an Object');
|
1263
|
+
}
|
1264
|
+
|
1265
|
+
$.extend(this._options.buttons, _buttons);
|
1266
|
+
|
1267
|
+
if (typeof this._options.buttons.showToday !== 'boolean') {
|
1268
|
+
throw new TypeError('buttons.showToday expects a boolean parameter');
|
1269
|
+
}
|
1270
|
+
if (typeof this._options.buttons.showClear !== 'boolean') {
|
1271
|
+
throw new TypeError('buttons.showClear expects a boolean parameter');
|
1272
|
+
}
|
1273
|
+
if (typeof this._options.buttons.showClose !== 'boolean') {
|
1274
|
+
throw new TypeError('buttons.showClose expects a boolean parameter');
|
1275
|
+
}
|
1276
|
+
|
1277
|
+
if (this.widget) {
|
1278
|
+
this.hide();
|
1279
|
+
this.show();
|
1280
|
+
}
|
1281
|
+
};
|
1282
|
+
|
1283
|
+
DateTimePicker.prototype.keepOpen = function keepOpen(_keepOpen) {
|
1284
|
+
if (arguments.length === 0) {
|
1285
|
+
return this._options.keepOpen;
|
1286
|
+
}
|
1287
|
+
|
1288
|
+
if (typeof _keepOpen !== 'boolean') {
|
1289
|
+
throw new TypeError('keepOpen() expects a boolean parameter');
|
1290
|
+
}
|
1291
|
+
|
1292
|
+
this._options.keepOpen = _keepOpen;
|
1293
|
+
};
|
1294
|
+
|
1295
|
+
DateTimePicker.prototype.focusOnShow = function focusOnShow(_focusOnShow) {
|
1296
|
+
if (arguments.length === 0) {
|
1297
|
+
return this._options.focusOnShow;
|
1298
|
+
}
|
1299
|
+
|
1300
|
+
if (typeof _focusOnShow !== 'boolean') {
|
1301
|
+
throw new TypeError('focusOnShow() expects a boolean parameter');
|
1302
|
+
}
|
1303
|
+
|
1304
|
+
this._options.focusOnShow = _focusOnShow;
|
1305
|
+
};
|
1306
|
+
|
1307
|
+
DateTimePicker.prototype.inline = function inline(_inline) {
|
1308
|
+
if (arguments.length === 0) {
|
1309
|
+
return this._options.inline;
|
1310
|
+
}
|
1311
|
+
|
1312
|
+
if (typeof _inline !== 'boolean') {
|
1313
|
+
throw new TypeError('inline() expects a boolean parameter');
|
1314
|
+
}
|
1315
|
+
|
1316
|
+
this._options.inline = _inline;
|
1317
|
+
};
|
1318
|
+
|
1319
|
+
DateTimePicker.prototype.clear = function clear() {
|
1320
|
+
this._setValue(null); //todo
|
1321
|
+
};
|
1322
|
+
|
1323
|
+
DateTimePicker.prototype.keyBinds = function keyBinds(_keyBinds) {
|
1324
|
+
if (arguments.length === 0) {
|
1325
|
+
return this._options.keyBinds;
|
1326
|
+
}
|
1327
|
+
|
1328
|
+
this._options.keyBinds = _keyBinds;
|
1329
|
+
};
|
1330
|
+
|
1331
|
+
DateTimePicker.prototype.debug = function debug(_debug) {
|
1332
|
+
if (typeof _debug !== 'boolean') {
|
1333
|
+
throw new TypeError('debug() expects a boolean parameter');
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
this._options.debug = _debug;
|
1337
|
+
};
|
1338
|
+
|
1339
|
+
DateTimePicker.prototype.allowInputToggle = function allowInputToggle(_allowInputToggle) {
|
1340
|
+
if (arguments.length === 0) {
|
1341
|
+
return this._options.allowInputToggle;
|
1342
|
+
}
|
1343
|
+
|
1344
|
+
if (typeof _allowInputToggle !== 'boolean') {
|
1345
|
+
throw new TypeError('allowInputToggle() expects a boolean parameter');
|
1346
|
+
}
|
1347
|
+
|
1348
|
+
this._options.allowInputToggle = _allowInputToggle;
|
1349
|
+
};
|
1350
|
+
|
1351
|
+
DateTimePicker.prototype.keepInvalid = function keepInvalid(_keepInvalid) {
|
1352
|
+
if (arguments.length === 0) {
|
1353
|
+
return this._options.keepInvalid;
|
1354
|
+
}
|
1355
|
+
|
1356
|
+
if (typeof _keepInvalid !== 'boolean') {
|
1357
|
+
throw new TypeError('keepInvalid() expects a boolean parameter');
|
1358
|
+
}
|
1359
|
+
this._options.keepInvalid = _keepInvalid;
|
1360
|
+
};
|
1361
|
+
|
1362
|
+
DateTimePicker.prototype.datepickerInput = function datepickerInput(_datepickerInput) {
|
1363
|
+
if (arguments.length === 0) {
|
1364
|
+
return this._options.datepickerInput;
|
1365
|
+
}
|
1366
|
+
|
1367
|
+
if (typeof _datepickerInput !== 'string') {
|
1368
|
+
throw new TypeError('datepickerInput() expects a string parameter');
|
1369
|
+
}
|
1370
|
+
|
1371
|
+
this._options.datepickerInput = _datepickerInput;
|
1372
|
+
};
|
1373
|
+
|
1374
|
+
DateTimePicker.prototype.parseInputDate = function parseInputDate(_parseInputDate2) {
|
1375
|
+
if (arguments.length === 0) {
|
1376
|
+
return this._options.parseInputDate;
|
1377
|
+
}
|
1378
|
+
|
1379
|
+
if (typeof _parseInputDate2 !== 'function') {
|
1380
|
+
throw new TypeError('parseInputDate() should be as function');
|
1381
|
+
}
|
1382
|
+
|
1383
|
+
this._options.parseInputDate = _parseInputDate2;
|
1384
|
+
};
|
1385
|
+
|
1386
|
+
DateTimePicker.prototype.disabledTimeIntervals = function disabledTimeIntervals(_disabledTimeIntervals) {
|
1387
|
+
if (arguments.length === 0) {
|
1388
|
+
return this._options.disabledTimeIntervals ? $.extend({}, this._options.disabledTimeIntervals) : this._options.disabledTimeIntervals;
|
1389
|
+
}
|
1390
|
+
|
1391
|
+
if (!_disabledTimeIntervals) {
|
1392
|
+
this._options.disabledTimeIntervals = false;
|
1393
|
+
this._update();
|
1394
|
+
return true;
|
1395
|
+
}
|
1396
|
+
if (!(_disabledTimeIntervals instanceof Array)) {
|
1397
|
+
throw new TypeError('disabledTimeIntervals() expects an array parameter');
|
1398
|
+
}
|
1399
|
+
this._options.disabledTimeIntervals = _disabledTimeIntervals;
|
1400
|
+
this._update();
|
1401
|
+
};
|
1402
|
+
|
1403
|
+
DateTimePicker.prototype.disabledHours = function disabledHours(hours) {
|
1404
|
+
if (arguments.length === 0) {
|
1405
|
+
return this._options.disabledHours ? $.extend({}, this._options.disabledHours) : this._options.disabledHours;
|
1406
|
+
}
|
1407
|
+
|
1408
|
+
if (!hours) {
|
1409
|
+
this._options.disabledHours = false;
|
1410
|
+
this._update();
|
1411
|
+
return true;
|
1412
|
+
}
|
1413
|
+
if (!(hours instanceof Array)) {
|
1414
|
+
throw new TypeError('disabledHours() expects an array parameter');
|
1415
|
+
}
|
1416
|
+
this._options.disabledHours = this._indexGivenHours(hours);
|
1417
|
+
this._options.enabledHours = false;
|
1418
|
+
if (this._options.useCurrent && !this._options.keepInvalid) {
|
1419
|
+
for (var i = 0; i < this._dates.length; i++) {
|
1420
|
+
var tries = 0;
|
1421
|
+
while (!this._isValid(this._dates[i], 'h')) {
|
1422
|
+
this._dates[i].add(1, 'h');
|
1423
|
+
if (tries === 24) {
|
1424
|
+
throw 'Tried 24 times to find a valid date';
|
1425
|
+
}
|
1426
|
+
tries++;
|
1427
|
+
}
|
1428
|
+
this._setValue(this._dates[i], i);
|
1429
|
+
}
|
1430
|
+
}
|
1431
|
+
this._update();
|
1432
|
+
};
|
1433
|
+
|
1434
|
+
DateTimePicker.prototype.enabledHours = function enabledHours(hours) {
|
1435
|
+
if (arguments.length === 0) {
|
1436
|
+
return this._options.enabledHours ? $.extend({}, this._options.enabledHours) : this._options.enabledHours;
|
1437
|
+
}
|
1438
|
+
|
1439
|
+
if (!hours) {
|
1440
|
+
this._options.enabledHours = false;
|
1441
|
+
this._update();
|
1442
|
+
return true;
|
1443
|
+
}
|
1444
|
+
if (!(hours instanceof Array)) {
|
1445
|
+
throw new TypeError('enabledHours() expects an array parameter');
|
1446
|
+
}
|
1447
|
+
this._options.enabledHours = this._indexGivenHours(hours);
|
1448
|
+
this._options.disabledHours = false;
|
1449
|
+
if (this._options.useCurrent && !this._options.keepInvalid) {
|
1450
|
+
for (var i = 0; i < this._dates.length; i++) {
|
1451
|
+
var tries = 0;
|
1452
|
+
while (!this._isValid(this._dates[i], 'h')) {
|
1453
|
+
this._dates[i].add(1, 'h');
|
1454
|
+
if (tries === 24) {
|
1455
|
+
throw 'Tried 24 times to find a valid date';
|
1456
|
+
}
|
1457
|
+
tries++;
|
1458
|
+
}
|
1459
|
+
this._setValue(this._dates[i], i);
|
1460
|
+
}
|
1461
|
+
}
|
1462
|
+
this._update();
|
1463
|
+
};
|
1464
|
+
|
1465
|
+
DateTimePicker.prototype.viewDate = function viewDate(newDate) {
|
1466
|
+
if (arguments.length === 0) {
|
1467
|
+
return this._viewDate.clone();
|
1468
|
+
}
|
1469
|
+
|
1470
|
+
if (!newDate) {
|
1471
|
+
this._viewDate = (this._dates[0] || this.getMoment()).clone();
|
1472
|
+
return true;
|
1473
|
+
}
|
1474
|
+
|
1475
|
+
if (typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
|
1476
|
+
throw new TypeError('viewDate() parameter must be one of [string, moment or Date]');
|
1477
|
+
}
|
1478
|
+
|
1479
|
+
this._viewDate = this._parseInputDate(newDate);
|
1480
|
+
this._viewUpdate();
|
1481
|
+
};
|
1482
|
+
|
1483
|
+
DateTimePicker.prototype.allowMultidate = function allowMultidate(_allowMultidate) {
|
1484
|
+
if (typeof _allowMultidate !== 'boolean') {
|
1485
|
+
throw new TypeError('allowMultidate() expects a boolean parameter');
|
1486
|
+
}
|
1487
|
+
|
1488
|
+
this._options.allowMultidate = _allowMultidate;
|
1489
|
+
};
|
1490
|
+
|
1491
|
+
DateTimePicker.prototype.multidateSeparator = function multidateSeparator(_multidateSeparator) {
|
1492
|
+
if (arguments.length === 0) {
|
1493
|
+
return this._options.multidateSeparator;
|
1494
|
+
}
|
1495
|
+
|
1496
|
+
if (typeof _multidateSeparator !== 'string' || _multidateSeparator.length > 1) {
|
1497
|
+
throw new TypeError('multidateSeparator expects a single character string parameter');
|
1498
|
+
}
|
1499
|
+
|
1500
|
+
this._options.multidateSeparator = _multidateSeparator;
|
1501
|
+
};
|
1502
|
+
|
1503
|
+
_createClass(DateTimePicker, null, [{
|
1504
|
+
key: 'NAME',
|
1505
|
+
get: function get() {
|
1506
|
+
return NAME;
|
1507
|
+
}
|
1508
|
+
|
1509
|
+
/**
|
1510
|
+
* @return {string}
|
1511
|
+
*/
|
1512
|
+
|
1513
|
+
}, {
|
1514
|
+
key: 'DATA_KEY',
|
1515
|
+
get: function get() {
|
1516
|
+
return DATA_KEY;
|
1517
|
+
}
|
1518
|
+
|
1519
|
+
/**
|
1520
|
+
* @return {string}
|
1521
|
+
*/
|
1522
|
+
|
1523
|
+
}, {
|
1524
|
+
key: 'EVENT_KEY',
|
1525
|
+
get: function get() {
|
1526
|
+
return EVENT_KEY;
|
1527
|
+
}
|
1528
|
+
|
1529
|
+
/**
|
1530
|
+
* @return {string}
|
1531
|
+
*/
|
1532
|
+
|
1533
|
+
}, {
|
1534
|
+
key: 'DATA_API_KEY',
|
1535
|
+
get: function get() {
|
1536
|
+
return DATA_API_KEY;
|
1537
|
+
}
|
1538
|
+
}, {
|
1539
|
+
key: 'DatePickerModes',
|
1540
|
+
get: function get() {
|
1541
|
+
return DatePickerModes;
|
1542
|
+
}
|
1543
|
+
}, {
|
1544
|
+
key: 'ViewModes',
|
1545
|
+
get: function get() {
|
1546
|
+
return ViewModes;
|
1547
|
+
}
|
1548
|
+
}, {
|
1549
|
+
key: 'Event',
|
1550
|
+
get: function get() {
|
1551
|
+
return Event;
|
1552
|
+
}
|
1553
|
+
}, {
|
1554
|
+
key: 'Selector',
|
1555
|
+
get: function get() {
|
1556
|
+
return Selector;
|
1557
|
+
}
|
1558
|
+
}, {
|
1559
|
+
key: 'Default',
|
1560
|
+
get: function get() {
|
1561
|
+
return Default;
|
1562
|
+
},
|
1563
|
+
set: function set(value) {
|
1564
|
+
Default = value;
|
1565
|
+
}
|
1566
|
+
}, {
|
1567
|
+
key: 'ClassName',
|
1568
|
+
get: function get() {
|
1569
|
+
return ClassName;
|
1570
|
+
}
|
1571
|
+
}]);
|
1572
|
+
|
1573
|
+
return DateTimePicker;
|
1574
|
+
}();
|
1575
|
+
|
1576
|
+
return DateTimePicker;
|
1577
|
+
}(jQuery, moment);
|
1578
|
+
|
1579
|
+
//noinspection JSUnusedGlobalSymbols
|
1580
|
+
/* global DateTimePicker */
|
1581
|
+
var TempusDominusBootstrap4 = function ($) {
|
1582
|
+
// eslint-disable-line no-unused-vars
|
1583
|
+
// ReSharper disable once InconsistentNaming
|
1584
|
+
var JQUERY_NO_CONFLICT = $.fn[DateTimePicker.NAME],
|
1585
|
+
verticalModes = ['top', 'bottom', 'auto'],
|
1586
|
+
horizontalModes = ['left', 'right', 'auto'],
|
1587
|
+
toolbarPlacements = ['default', 'top', 'bottom'],
|
1588
|
+
getSelectorFromElement = function getSelectorFromElement($element) {
|
1589
|
+
var selector = $element.data('target'),
|
1590
|
+
$selector = void 0;
|
1591
|
+
|
1592
|
+
if (!selector) {
|
1593
|
+
selector = $element.attr('href') || '';
|
1594
|
+
selector = /^#[a-z]/i.test(selector) ? selector : null;
|
1595
|
+
}
|
1596
|
+
$selector = $(selector);
|
1597
|
+
if ($selector.length === 0) {
|
1598
|
+
return $selector;
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
if (!$selector.data(DateTimePicker.DATA_KEY)) {
|
1602
|
+
$.extend({}, $selector.data(), $(this).data());
|
1603
|
+
}
|
1604
|
+
|
1605
|
+
return $selector;
|
1606
|
+
};
|
1607
|
+
|
1608
|
+
// ReSharper disable once InconsistentNaming
|
1609
|
+
|
1610
|
+
var TempusDominusBootstrap4 = function (_DateTimePicker) {
|
1611
|
+
_inherits(TempusDominusBootstrap4, _DateTimePicker);
|
1612
|
+
|
1613
|
+
function TempusDominusBootstrap4(element, options) {
|
1614
|
+
_classCallCheck(this, TempusDominusBootstrap4);
|
1615
|
+
|
1616
|
+
var _this = _possibleConstructorReturn(this, _DateTimePicker.call(this, element, options));
|
1617
|
+
|
1618
|
+
_this._init();
|
1619
|
+
return _this;
|
1620
|
+
}
|
1621
|
+
|
1622
|
+
TempusDominusBootstrap4.prototype._init = function _init() {
|
1623
|
+
if (this._element.hasClass('input-group')) {
|
1624
|
+
var datepickerButton = this._element.find('.datepickerbutton');
|
1625
|
+
if (datepickerButton.length === 0) {
|
1626
|
+
this.component = this._element.find('[data-toggle="datetimepicker"]');
|
1627
|
+
} else {
|
1628
|
+
this.component = datepickerButton;
|
1629
|
+
}
|
1630
|
+
}
|
1631
|
+
};
|
1632
|
+
|
1633
|
+
TempusDominusBootstrap4.prototype._getDatePickerTemplate = function _getDatePickerTemplate() {
|
1634
|
+
var headTemplate = $('<thead>').append($('<tr>').append($('<th>').addClass('prev').attr('data-action', 'previous').append($('<span>').addClass(this._options.icons.previous))).append($('<th>').addClass('picker-switch').attr('data-action', 'pickerSwitch').attr('colspan', '' + (this._options.calendarWeeks ? '6' : '5'))).append($('<th>').addClass('next').attr('data-action', 'next').append($('<span>').addClass(this._options.icons.next)))),
|
1635
|
+
contTemplate = $('<tbody>').append($('<tr>').append($('<td>').attr('colspan', '' + (this._options.calendarWeeks ? '8' : '7'))));
|
1636
|
+
|
1637
|
+
return [$('<div>').addClass('datepicker-days').append($('<table>').addClass('table table-sm').append(headTemplate).append($('<tbody>'))), $('<div>').addClass('datepicker-months').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())), $('<div>').addClass('datepicker-years').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())), $('<div>').addClass('datepicker-decades').append($('<table>').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone()))];
|
1638
|
+
};
|
1639
|
+
|
1640
|
+
TempusDominusBootstrap4.prototype._getTimePickerMainTemplate = function _getTimePickerMainTemplate() {
|
1641
|
+
var topRow = $('<tr>'),
|
1642
|
+
middleRow = $('<tr>'),
|
1643
|
+
bottomRow = $('<tr>');
|
1644
|
+
|
1645
|
+
if (this._isEnabled('h')) {
|
1646
|
+
topRow.append($('<td>').append($('<a>').attr({
|
1647
|
+
href: '#',
|
1648
|
+
tabindex: '-1',
|
1649
|
+
'title': this._options.tooltips.incrementHour
|
1650
|
+
}).addClass('btn').attr('data-action', 'incrementHours').append($('<span>').addClass(this._options.icons.up))));
|
1651
|
+
middleRow.append($('<td>').append($('<span>').addClass('timepicker-hour').attr({
|
1652
|
+
'data-time-component': 'hours',
|
1653
|
+
'title': this._options.tooltips.pickHour
|
1654
|
+
}).attr('data-action', 'showHours')));
|
1655
|
+
bottomRow.append($('<td>').append($('<a>').attr({
|
1656
|
+
href: '#',
|
1657
|
+
tabindex: '-1',
|
1658
|
+
'title': this._options.tooltips.decrementHour
|
1659
|
+
}).addClass('btn').attr('data-action', 'decrementHours').append($('<span>').addClass(this._options.icons.down))));
|
1660
|
+
}
|
1661
|
+
if (this._isEnabled('m')) {
|
1662
|
+
if (this._isEnabled('h')) {
|
1663
|
+
topRow.append($('<td>').addClass('separator'));
|
1664
|
+
middleRow.append($('<td>').addClass('separator').html(':'));
|
1665
|
+
bottomRow.append($('<td>').addClass('separator'));
|
1666
|
+
}
|
1667
|
+
topRow.append($('<td>').append($('<a>').attr({
|
1668
|
+
href: '#',
|
1669
|
+
tabindex: '-1',
|
1670
|
+
'title': this._options.tooltips.incrementMinute
|
1671
|
+
}).addClass('btn').attr('data-action', 'incrementMinutes').append($('<span>').addClass(this._options.icons.up))));
|
1672
|
+
middleRow.append($('<td>').append($('<span>').addClass('timepicker-minute').attr({
|
1673
|
+
'data-time-component': 'minutes',
|
1674
|
+
'title': this._options.tooltips.pickMinute
|
1675
|
+
}).attr('data-action', 'showMinutes')));
|
1676
|
+
bottomRow.append($('<td>').append($('<a>').attr({
|
1677
|
+
href: '#',
|
1678
|
+
tabindex: '-1',
|
1679
|
+
'title': this._options.tooltips.decrementMinute
|
1680
|
+
}).addClass('btn').attr('data-action', 'decrementMinutes').append($('<span>').addClass(this._options.icons.down))));
|
1681
|
+
}
|
1682
|
+
if (this._isEnabled('s')) {
|
1683
|
+
if (this._isEnabled('m')) {
|
1684
|
+
topRow.append($('<td>').addClass('separator'));
|
1685
|
+
middleRow.append($('<td>').addClass('separator').html(':'));
|
1686
|
+
bottomRow.append($('<td>').addClass('separator'));
|
1687
|
+
}
|
1688
|
+
topRow.append($('<td>').append($('<a>').attr({
|
1689
|
+
href: '#',
|
1690
|
+
tabindex: '-1',
|
1691
|
+
'title': this._options.tooltips.incrementSecond
|
1692
|
+
}).addClass('btn').attr('data-action', 'incrementSeconds').append($('<span>').addClass(this._options.icons.up))));
|
1693
|
+
middleRow.append($('<td>').append($('<span>').addClass('timepicker-second').attr({
|
1694
|
+
'data-time-component': 'seconds',
|
1695
|
+
'title': this._options.tooltips.pickSecond
|
1696
|
+
}).attr('data-action', 'showSeconds')));
|
1697
|
+
bottomRow.append($('<td>').append($('<a>').attr({
|
1698
|
+
href: '#',
|
1699
|
+
tabindex: '-1',
|
1700
|
+
'title': this._options.tooltips.decrementSecond
|
1701
|
+
}).addClass('btn').attr('data-action', 'decrementSeconds').append($('<span>').addClass(this._options.icons.down))));
|
1702
|
+
}
|
1703
|
+
|
1704
|
+
if (!this.use24Hours) {
|
1705
|
+
topRow.append($('<td>').addClass('separator'));
|
1706
|
+
middleRow.append($('<td>').append($('<button>').addClass('btn btn-primary').attr({
|
1707
|
+
'data-action': 'togglePeriod',
|
1708
|
+
tabindex: '-1',
|
1709
|
+
'title': this._options.tooltips.togglePeriod
|
1710
|
+
})));
|
1711
|
+
bottomRow.append($('<td>').addClass('separator'));
|
1712
|
+
}
|
1713
|
+
|
1714
|
+
return $('<div>').addClass('timepicker-picker').append($('<table>').addClass('table-condensed').append([topRow, middleRow, bottomRow]));
|
1715
|
+
};
|
1716
|
+
|
1717
|
+
TempusDominusBootstrap4.prototype._getTimePickerTemplate = function _getTimePickerTemplate() {
|
1718
|
+
var hoursView = $('<div>').addClass('timepicker-hours').append($('<table>').addClass('table-condensed')),
|
1719
|
+
minutesView = $('<div>').addClass('timepicker-minutes').append($('<table>').addClass('table-condensed')),
|
1720
|
+
secondsView = $('<div>').addClass('timepicker-seconds').append($('<table>').addClass('table-condensed')),
|
1721
|
+
ret = [this._getTimePickerMainTemplate()];
|
1722
|
+
|
1723
|
+
if (this._isEnabled('h')) {
|
1724
|
+
ret.push(hoursView);
|
1725
|
+
}
|
1726
|
+
if (this._isEnabled('m')) {
|
1727
|
+
ret.push(minutesView);
|
1728
|
+
}
|
1729
|
+
if (this._isEnabled('s')) {
|
1730
|
+
ret.push(secondsView);
|
1731
|
+
}
|
1732
|
+
|
1733
|
+
return ret;
|
1734
|
+
};
|
1735
|
+
|
1736
|
+
TempusDominusBootstrap4.prototype._getToolbar = function _getToolbar() {
|
1737
|
+
var row = [];
|
1738
|
+
if (this._options.buttons.showToday) {
|
1739
|
+
row.push($('<td>').append($('<a>').attr({
|
1740
|
+
href: '#',
|
1741
|
+
tabindex: '-1',
|
1742
|
+
'data-action': 'today',
|
1743
|
+
'title': this._options.tooltips.today
|
1744
|
+
}).append($('<span>').addClass(this._options.icons.today))));
|
1745
|
+
}
|
1746
|
+
if (!this._options.sideBySide && this._hasDate() && this._hasTime()) {
|
1747
|
+
var title = void 0,
|
1748
|
+
icon = void 0;
|
1749
|
+
if (this._options.viewMode === 'times') {
|
1750
|
+
title = this._options.tooltips.selectDate;
|
1751
|
+
icon = this._options.icons.date;
|
1752
|
+
} else {
|
1753
|
+
title = this._options.tooltips.selectTime;
|
1754
|
+
icon = this._options.icons.time;
|
1755
|
+
}
|
1756
|
+
row.push($('<td>').append($('<a>').attr({
|
1757
|
+
href: '#',
|
1758
|
+
tabindex: '-1',
|
1759
|
+
'data-action': 'togglePicker',
|
1760
|
+
'title': title
|
1761
|
+
}).append($('<span>').addClass(icon))));
|
1762
|
+
}
|
1763
|
+
if (this._options.buttons.showClear) {
|
1764
|
+
row.push($('<td>').append($('<a>').attr({
|
1765
|
+
href: '#',
|
1766
|
+
tabindex: '-1',
|
1767
|
+
'data-action': 'clear',
|
1768
|
+
'title': this._options.tooltips.clear
|
1769
|
+
}).append($('<span>').addClass(this._options.icons.clear))));
|
1770
|
+
}
|
1771
|
+
if (this._options.buttons.showClose) {
|
1772
|
+
row.push($('<td>').append($('<a>').attr({
|
1773
|
+
href: '#',
|
1774
|
+
tabindex: '-1',
|
1775
|
+
'data-action': 'close',
|
1776
|
+
'title': this._options.tooltips.close
|
1777
|
+
}).append($('<span>').addClass(this._options.icons.close))));
|
1778
|
+
}
|
1779
|
+
return row.length === 0 ? '' : $('<table>').addClass('table-condensed').append($('<tbody>').append($('<tr>').append(row)));
|
1780
|
+
};
|
1781
|
+
|
1782
|
+
TempusDominusBootstrap4.prototype._getTemplate = function _getTemplate() {
|
1783
|
+
var template = $('<div>').addClass('bootstrap-datetimepicker-widget dropdown-menu'),
|
1784
|
+
dateView = $('<div>').addClass('datepicker').append(this._getDatePickerTemplate()),
|
1785
|
+
timeView = $('<div>').addClass('timepicker').append(this._getTimePickerTemplate()),
|
1786
|
+
content = $('<ul>').addClass('list-unstyled'),
|
1787
|
+
toolbar = $('<li>').addClass('picker-switch' + (this._options.collapse ? ' accordion-toggle' : '')).append(this._getToolbar());
|
1788
|
+
|
1789
|
+
if (this._options.inline) {
|
1790
|
+
template.removeClass('dropdown-menu');
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
if (this.use24Hours) {
|
1794
|
+
template.addClass('usetwentyfour');
|
1795
|
+
}
|
1796
|
+
if (this._isEnabled('s') && !this.use24Hours) {
|
1797
|
+
template.addClass('wider');
|
1798
|
+
}
|
1799
|
+
|
1800
|
+
if (this._options.sideBySide && this._hasDate() && this._hasTime()) {
|
1801
|
+
template.addClass('timepicker-sbs');
|
1802
|
+
if (this._options.toolbarPlacement === 'top') {
|
1803
|
+
template.append(toolbar);
|
1804
|
+
}
|
1805
|
+
template.append($('<div>').addClass('row').append(dateView.addClass('col-md-6')).append(timeView.addClass('col-md-6')));
|
1806
|
+
if (this._options.toolbarPlacement === 'bottom' || this._options.toolbarPlacement === 'default') {
|
1807
|
+
template.append(toolbar);
|
1808
|
+
}
|
1809
|
+
return template;
|
1810
|
+
}
|
1811
|
+
|
1812
|
+
if (this._options.toolbarPlacement === 'top') {
|
1813
|
+
content.append(toolbar);
|
1814
|
+
}
|
1815
|
+
if (this._hasDate()) {
|
1816
|
+
content.append($('<li>').addClass(this._options.collapse && this._hasTime() ? 'collapse' : '').addClass(this._options.collapse && this._hasTime() && this._options.viewMode === 'times' ? '' : 'show').append(dateView));
|
1817
|
+
}
|
1818
|
+
if (this._options.toolbarPlacement === 'default') {
|
1819
|
+
content.append(toolbar);
|
1820
|
+
}
|
1821
|
+
if (this._hasTime()) {
|
1822
|
+
content.append($('<li>').addClass(this._options.collapse && this._hasDate() ? 'collapse' : '').addClass(this._options.collapse && this._hasDate() && this._options.viewMode === 'times' ? 'show' : '').append(timeView));
|
1823
|
+
}
|
1824
|
+
if (this._options.toolbarPlacement === 'bottom') {
|
1825
|
+
content.append(toolbar);
|
1826
|
+
}
|
1827
|
+
return template.append(content);
|
1828
|
+
};
|
1829
|
+
|
1830
|
+
TempusDominusBootstrap4.prototype._place = function _place(e) {
|
1831
|
+
var self = e && e.data && e.data.picker || this,
|
1832
|
+
vertical = self._options.widgetPositioning.vertical,
|
1833
|
+
horizontal = self._options.widgetPositioning.horizontal,
|
1834
|
+
parent = void 0;
|
1835
|
+
var position = (self.component && self.component.length ? self.component : self._element).position(),
|
1836
|
+
offset = (self.component && self.component.length ? self.component : self._element).offset();
|
1837
|
+
if (self._options.widgetParent) {
|
1838
|
+
parent = self._options.widgetParent.append(self.widget);
|
1839
|
+
} else if (self._element.is('input')) {
|
1840
|
+
parent = self._element.after(self.widget).parent();
|
1841
|
+
} else if (self._options.inline) {
|
1842
|
+
parent = self._element.append(self.widget);
|
1843
|
+
return;
|
1844
|
+
} else {
|
1845
|
+
parent = self._element;
|
1846
|
+
self._element.children().first().after(self.widget);
|
1847
|
+
}
|
1848
|
+
|
1849
|
+
// Top and bottom logic
|
1850
|
+
if (vertical === 'auto') {
|
1851
|
+
//noinspection JSValidateTypes
|
1852
|
+
if (offset.top + self.widget.height() * 1.5 >= $(window).height() + $(window).scrollTop() && self.widget.height() + self._element.outerHeight() < offset.top) {
|
1853
|
+
vertical = 'top';
|
1854
|
+
} else {
|
1855
|
+
vertical = 'bottom';
|
1856
|
+
}
|
1857
|
+
}
|
1858
|
+
|
1859
|
+
// Left and right logic
|
1860
|
+
if (horizontal === 'auto') {
|
1861
|
+
if (parent.width() < offset.left + self.widget.outerWidth() / 2 && offset.left + self.widget.outerWidth() > $(window).width()) {
|
1862
|
+
horizontal = 'right';
|
1863
|
+
} else {
|
1864
|
+
horizontal = 'left';
|
1865
|
+
}
|
1866
|
+
}
|
1867
|
+
|
1868
|
+
if (vertical === 'top') {
|
1869
|
+
self.widget.addClass('top').removeClass('bottom');
|
1870
|
+
} else {
|
1871
|
+
self.widget.addClass('bottom').removeClass('top');
|
1872
|
+
}
|
1873
|
+
|
1874
|
+
if (horizontal === 'right') {
|
1875
|
+
self.widget.addClass('float-right');
|
1876
|
+
} else {
|
1877
|
+
self.widget.removeClass('float-right');
|
1878
|
+
}
|
1879
|
+
|
1880
|
+
// find the first parent element that has a relative css positioning
|
1881
|
+
if (parent.css('position') !== 'relative') {
|
1882
|
+
parent = parent.parents().filter(function () {
|
1883
|
+
return $(this).css('position') === 'relative';
|
1884
|
+
}).first();
|
1885
|
+
}
|
1886
|
+
|
1887
|
+
if (parent.length === 0) {
|
1888
|
+
throw new Error('datetimepicker component should be placed within a relative positioned container');
|
1889
|
+
}
|
1890
|
+
|
1891
|
+
self.widget.css({
|
1892
|
+
top: vertical === 'top' ? 'auto' : position.top + self._element.outerHeight() + 'px',
|
1893
|
+
bottom: vertical === 'top' ? parent.outerHeight() - (parent === self._element ? 0 : position.top) + 'px' : 'auto',
|
1894
|
+
left: horizontal === 'left' ? (parent === self._element ? 0 : position.left) + 'px' : 'auto',
|
1895
|
+
right: horizontal === 'left' ? 'auto' : parent.outerWidth() - self._element.outerWidth() - (parent === self._element ? 0 : position.left) + 'px'
|
1896
|
+
});
|
1897
|
+
};
|
1898
|
+
|
1899
|
+
TempusDominusBootstrap4.prototype._fillDow = function _fillDow() {
|
1900
|
+
var row = $('<tr>'),
|
1901
|
+
currentDate = this._viewDate.clone().startOf('w').startOf('d');
|
1902
|
+
|
1903
|
+
if (this._options.calendarWeeks === true) {
|
1904
|
+
row.append($('<th>').addClass('cw').text('#'));
|
1905
|
+
}
|
1906
|
+
|
1907
|
+
while (currentDate.isBefore(this._viewDate.clone().endOf('w'))) {
|
1908
|
+
row.append($('<th>').addClass('dow').text(currentDate.format('dd')));
|
1909
|
+
currentDate.add(1, 'd');
|
1910
|
+
}
|
1911
|
+
this.widget.find('.datepicker-days thead').append(row);
|
1912
|
+
};
|
1913
|
+
|
1914
|
+
TempusDominusBootstrap4.prototype._fillMonths = function _fillMonths() {
|
1915
|
+
var spans = [],
|
1916
|
+
monthsShort = this._viewDate.clone().startOf('y').startOf('d');
|
1917
|
+
while (monthsShort.isSame(this._viewDate, 'y')) {
|
1918
|
+
spans.push($('<span>').attr('data-action', 'selectMonth').addClass('month').text(monthsShort.format('MMM')));
|
1919
|
+
monthsShort.add(1, 'M');
|
1920
|
+
}
|
1921
|
+
this.widget.find('.datepicker-months td').empty().append(spans);
|
1922
|
+
};
|
1923
|
+
|
1924
|
+
TempusDominusBootstrap4.prototype._updateMonths = function _updateMonths() {
|
1925
|
+
var monthsView = this.widget.find('.datepicker-months'),
|
1926
|
+
monthsViewHeader = monthsView.find('th'),
|
1927
|
+
months = monthsView.find('tbody').find('span'),
|
1928
|
+
self = this;
|
1929
|
+
|
1930
|
+
monthsViewHeader.eq(0).find('span').attr('title', this._options.tooltips.prevYear);
|
1931
|
+
monthsViewHeader.eq(1).attr('title', this._options.tooltips.selectYear);
|
1932
|
+
monthsViewHeader.eq(2).find('span').attr('title', this._options.tooltips.nextYear);
|
1933
|
+
|
1934
|
+
monthsView.find('.disabled').removeClass('disabled');
|
1935
|
+
|
1936
|
+
if (!this._isValid(this._viewDate.clone().subtract(1, 'y'), 'y')) {
|
1937
|
+
monthsViewHeader.eq(0).addClass('disabled');
|
1938
|
+
}
|
1939
|
+
|
1940
|
+
monthsViewHeader.eq(1).text(this._viewDate.year());
|
1941
|
+
|
1942
|
+
if (!this._isValid(this._viewDate.clone().add(1, 'y'), 'y')) {
|
1943
|
+
monthsViewHeader.eq(2).addClass('disabled');
|
1944
|
+
}
|
1945
|
+
|
1946
|
+
months.removeClass('active');
|
1947
|
+
if (this._getLastPickedDate().isSame(this._viewDate, 'y') && !this.unset) {
|
1948
|
+
months.eq(this._getLastPickedDate().month()).addClass('active');
|
1949
|
+
}
|
1950
|
+
|
1951
|
+
months.each(function (index) {
|
1952
|
+
if (!self._isValid(self._viewDate.clone().month(index), 'M')) {
|
1953
|
+
$(this).addClass('disabled');
|
1954
|
+
}
|
1955
|
+
});
|
1956
|
+
};
|
1957
|
+
|
1958
|
+
TempusDominusBootstrap4.prototype._getStartEndYear = function _getStartEndYear(factor, year) {
|
1959
|
+
var step = factor / 10,
|
1960
|
+
startYear = Math.floor(year / factor) * factor,
|
1961
|
+
endYear = startYear + step * 9,
|
1962
|
+
focusValue = Math.floor(year / step) * step;
|
1963
|
+
return [startYear, endYear, focusValue];
|
1964
|
+
};
|
1965
|
+
|
1966
|
+
TempusDominusBootstrap4.prototype._updateYears = function _updateYears() {
|
1967
|
+
var yearsView = this.widget.find('.datepicker-years'),
|
1968
|
+
yearsViewHeader = yearsView.find('th'),
|
1969
|
+
yearCaps = this._getStartEndYear(10, this._viewDate.year()),
|
1970
|
+
startYear = this._viewDate.clone().year(yearCaps[0]),
|
1971
|
+
endYear = this._viewDate.clone().year(yearCaps[1]);
|
1972
|
+
var html = '';
|
1973
|
+
|
1974
|
+
yearsViewHeader.eq(0).find('span').attr('title', this._options.tooltips.prevDecade);
|
1975
|
+
yearsViewHeader.eq(1).attr('title', this._options.tooltips.selectDecade);
|
1976
|
+
yearsViewHeader.eq(2).find('span').attr('title', this._options.tooltips.nextDecade);
|
1977
|
+
|
1978
|
+
yearsView.find('.disabled').removeClass('disabled');
|
1979
|
+
|
1980
|
+
if (this._options.minDate && this._options.minDate.isAfter(startYear, 'y')) {
|
1981
|
+
yearsViewHeader.eq(0).addClass('disabled');
|
1982
|
+
}
|
1983
|
+
|
1984
|
+
yearsViewHeader.eq(1).text(startYear.year() + '-' + endYear.year());
|
1985
|
+
|
1986
|
+
if (this._options.maxDate && this._options.maxDate.isBefore(endYear, 'y')) {
|
1987
|
+
yearsViewHeader.eq(2).addClass('disabled');
|
1988
|
+
}
|
1989
|
+
|
1990
|
+
html += '<span data-action="selectYear" class="year old' + (!this._isValid(startYear, 'y') ? ' disabled' : '') + '">' + (startYear.year() - 1) + '</span>';
|
1991
|
+
while (!startYear.isAfter(endYear, 'y')) {
|
1992
|
+
html += '<span data-action="selectYear" class="year' + (startYear.isSame(this._getLastPickedDate(), 'y') && !this.unset ? ' active' : '') + (!this._isValid(startYear, 'y') ? ' disabled' : '') + '">' + startYear.year() + '</span>';
|
1993
|
+
startYear.add(1, 'y');
|
1994
|
+
}
|
1995
|
+
html += '<span data-action="selectYear" class="year old' + (!this._isValid(startYear, 'y') ? ' disabled' : '') + '">' + startYear.year() + '</span>';
|
1996
|
+
|
1997
|
+
yearsView.find('td').html(html);
|
1998
|
+
};
|
1999
|
+
|
2000
|
+
TempusDominusBootstrap4.prototype._updateDecades = function _updateDecades() {
|
2001
|
+
var decadesView = this.widget.find('.datepicker-decades'),
|
2002
|
+
decadesViewHeader = decadesView.find('th'),
|
2003
|
+
yearCaps = this._getStartEndYear(100, this._viewDate.year()),
|
2004
|
+
startDecade = this._viewDate.clone().year(yearCaps[0]),
|
2005
|
+
endDecade = this._viewDate.clone().year(yearCaps[1]);
|
2006
|
+
var minDateDecade = false,
|
2007
|
+
maxDateDecade = false,
|
2008
|
+
endDecadeYear = void 0,
|
2009
|
+
html = '';
|
2010
|
+
|
2011
|
+
decadesViewHeader.eq(0).find('span').attr('title', this._options.tooltips.prevCentury);
|
2012
|
+
decadesViewHeader.eq(2).find('span').attr('title', this._options.tooltips.nextCentury);
|
2013
|
+
|
2014
|
+
decadesView.find('.disabled').removeClass('disabled');
|
2015
|
+
|
2016
|
+
if (startDecade.year() === 0 || this._options.minDate && this._options.minDate.isAfter(startDecade, 'y')) {
|
2017
|
+
decadesViewHeader.eq(0).addClass('disabled');
|
2018
|
+
}
|
2019
|
+
|
2020
|
+
decadesViewHeader.eq(1).text(startDecade.year() + '-' + endDecade.year());
|
2021
|
+
|
2022
|
+
if (this._options.maxDate && this._options.maxDate.isBefore(endDecade, 'y')) {
|
2023
|
+
decadesViewHeader.eq(2).addClass('disabled');
|
2024
|
+
}
|
2025
|
+
|
2026
|
+
if (startDecade.year() - 10 < 0) {
|
2027
|
+
html += '<span> </span>';
|
2028
|
+
} else {
|
2029
|
+
html += '<span data-action="selectDecade" class="decade old" data-selection="' + (startDecade.year() + 6) + '">' + (startDecade.year() - 10) + '</span>';
|
2030
|
+
}
|
2031
|
+
|
2032
|
+
while (!startDecade.isAfter(endDecade, 'y')) {
|
2033
|
+
endDecadeYear = startDecade.year() + 11;
|
2034
|
+
minDateDecade = this._options.minDate && this._options.minDate.isAfter(startDecade, 'y') && this._options.minDate.year() <= endDecadeYear;
|
2035
|
+
maxDateDecade = this._options.maxDate && this._options.maxDate.isAfter(startDecade, 'y') && this._options.maxDate.year() <= endDecadeYear;
|
2036
|
+
html += '<span data-action="selectDecade" class="decade' + (this._getLastPickedDate().isAfter(startDecade) && this._getLastPickedDate().year() <= endDecadeYear ? ' active' : '') + (!this._isValid(startDecade, 'y') && !minDateDecade && !maxDateDecade ? ' disabled' : '') + '" data-selection="' + (startDecade.year() + 6) + '">' + startDecade.year() + '</span>';
|
2037
|
+
startDecade.add(10, 'y');
|
2038
|
+
}
|
2039
|
+
html += '<span data-action="selectDecade" class="decade old" data-selection="' + (startDecade.year() + 6) + '">' + startDecade.year() + '</span>';
|
2040
|
+
|
2041
|
+
decadesView.find('td').html(html);
|
2042
|
+
};
|
2043
|
+
|
2044
|
+
TempusDominusBootstrap4.prototype._fillDate = function _fillDate() {
|
2045
|
+
var daysView = this.widget.find('.datepicker-days'),
|
2046
|
+
daysViewHeader = daysView.find('th'),
|
2047
|
+
html = [];
|
2048
|
+
var currentDate = void 0,
|
2049
|
+
row = void 0,
|
2050
|
+
clsName = void 0,
|
2051
|
+
i = void 0;
|
2052
|
+
|
2053
|
+
if (!this._hasDate()) {
|
2054
|
+
return;
|
2055
|
+
}
|
2056
|
+
|
2057
|
+
daysViewHeader.eq(0).find('span').attr('title', this._options.tooltips.prevMonth);
|
2058
|
+
daysViewHeader.eq(1).attr('title', this._options.tooltips.selectMonth);
|
2059
|
+
daysViewHeader.eq(2).find('span').attr('title', this._options.tooltips.nextMonth);
|
2060
|
+
|
2061
|
+
daysView.find('.disabled').removeClass('disabled');
|
2062
|
+
daysViewHeader.eq(1).text(this._viewDate.format(this._options.dayViewHeaderFormat));
|
2063
|
+
|
2064
|
+
if (!this._isValid(this._viewDate.clone().subtract(1, 'M'), 'M')) {
|
2065
|
+
daysViewHeader.eq(0).addClass('disabled');
|
2066
|
+
}
|
2067
|
+
if (!this._isValid(this._viewDate.clone().add(1, 'M'), 'M')) {
|
2068
|
+
daysViewHeader.eq(2).addClass('disabled');
|
2069
|
+
}
|
2070
|
+
|
2071
|
+
currentDate = this._viewDate.clone().startOf('M').startOf('w').startOf('d');
|
2072
|
+
|
2073
|
+
for (i = 0; i < 42; i++) {
|
2074
|
+
//always display 42 days (should show 6 weeks)
|
2075
|
+
if (currentDate.weekday() === 0) {
|
2076
|
+
row = $('<tr>');
|
2077
|
+
if (this._options.calendarWeeks) {
|
2078
|
+
row.append('<td class="cw">' + currentDate.week() + '</td>');
|
2079
|
+
}
|
2080
|
+
html.push(row);
|
2081
|
+
}
|
2082
|
+
clsName = '';
|
2083
|
+
if (currentDate.isBefore(this._viewDate, 'M')) {
|
2084
|
+
clsName += ' old';
|
2085
|
+
}
|
2086
|
+
if (currentDate.isAfter(this._viewDate, 'M')) {
|
2087
|
+
clsName += ' new';
|
2088
|
+
}
|
2089
|
+
if (this._options.allowMultidate) {
|
2090
|
+
var index = this._datesFormatted.indexOf(currentDate.format('YYYY-MM-DD'));
|
2091
|
+
if (index !== -1) {
|
2092
|
+
if (currentDate.isSame(this._datesFormatted[index], 'd') && !this.unset) {
|
2093
|
+
clsName += ' active';
|
2094
|
+
}
|
2095
|
+
}
|
2096
|
+
} else {
|
2097
|
+
if (currentDate.isSame(this._getLastPickedDate(), 'd') && !this.unset) {
|
2098
|
+
clsName += ' active';
|
2099
|
+
}
|
2100
|
+
}
|
2101
|
+
if (!this._isValid(currentDate, 'd')) {
|
2102
|
+
clsName += ' disabled';
|
2103
|
+
}
|
2104
|
+
if (currentDate.isSame(this.getMoment(), 'd')) {
|
2105
|
+
clsName += ' today';
|
2106
|
+
}
|
2107
|
+
if (currentDate.day() === 0 || currentDate.day() === 6) {
|
2108
|
+
clsName += ' weekend';
|
2109
|
+
}
|
2110
|
+
row.append('<td data-action="selectDay" data-day="' + currentDate.format('L') + '" class="day' + clsName + '">' + currentDate.date() + '</td>');
|
2111
|
+
currentDate.add(1, 'd');
|
2112
|
+
}
|
2113
|
+
|
2114
|
+
daysView.find('tbody').empty().append(html);
|
2115
|
+
|
2116
|
+
this._updateMonths();
|
2117
|
+
|
2118
|
+
this._updateYears();
|
2119
|
+
|
2120
|
+
this._updateDecades();
|
2121
|
+
};
|
2122
|
+
|
2123
|
+
TempusDominusBootstrap4.prototype._fillHours = function _fillHours() {
|
2124
|
+
var table = this.widget.find('.timepicker-hours table'),
|
2125
|
+
currentHour = this._viewDate.clone().startOf('d'),
|
2126
|
+
html = [];
|
2127
|
+
var row = $('<tr>');
|
2128
|
+
|
2129
|
+
if (this._viewDate.hour() > 11 && !this.use24Hours) {
|
2130
|
+
currentHour.hour(12);
|
2131
|
+
}
|
2132
|
+
while (currentHour.isSame(this._viewDate, 'd') && (this.use24Hours || this._viewDate.hour() < 12 && currentHour.hour() < 12 || this._viewDate.hour() > 11)) {
|
2133
|
+
if (currentHour.hour() % 4 === 0) {
|
2134
|
+
row = $('<tr>');
|
2135
|
+
html.push(row);
|
2136
|
+
}
|
2137
|
+
row.append('<td data-action="selectHour" class="hour' + (!this._isValid(currentHour, 'h') ? ' disabled' : '') + '">' + currentHour.format(this.use24Hours ? 'HH' : 'hh') + '</td>');
|
2138
|
+
currentHour.add(1, 'h');
|
2139
|
+
}
|
2140
|
+
table.empty().append(html);
|
2141
|
+
};
|
2142
|
+
|
2143
|
+
TempusDominusBootstrap4.prototype._fillMinutes = function _fillMinutes() {
|
2144
|
+
var table = this.widget.find('.timepicker-minutes table'),
|
2145
|
+
currentMinute = this._viewDate.clone().startOf('h'),
|
2146
|
+
html = [],
|
2147
|
+
step = this._options.stepping === 1 ? 5 : this._options.stepping;
|
2148
|
+
var row = $('<tr>');
|
2149
|
+
|
2150
|
+
while (this._viewDate.isSame(currentMinute, 'h')) {
|
2151
|
+
if (currentMinute.minute() % (step * 4) === 0) {
|
2152
|
+
row = $('<tr>');
|
2153
|
+
html.push(row);
|
2154
|
+
}
|
2155
|
+
row.append('<td data-action="selectMinute" class="minute' + (!this._isValid(currentMinute, 'm') ? ' disabled' : '') + '">' + currentMinute.format('mm') + '</td>');
|
2156
|
+
currentMinute.add(step, 'm');
|
2157
|
+
}
|
2158
|
+
table.empty().append(html);
|
2159
|
+
};
|
2160
|
+
|
2161
|
+
TempusDominusBootstrap4.prototype._fillSeconds = function _fillSeconds() {
|
2162
|
+
var table = this.widget.find('.timepicker-seconds table'),
|
2163
|
+
currentSecond = this._viewDate.clone().startOf('m'),
|
2164
|
+
html = [];
|
2165
|
+
var row = $('<tr>');
|
2166
|
+
|
2167
|
+
while (this._viewDate.isSame(currentSecond, 'm')) {
|
2168
|
+
if (currentSecond.second() % 20 === 0) {
|
2169
|
+
row = $('<tr>');
|
2170
|
+
html.push(row);
|
2171
|
+
}
|
2172
|
+
row.append('<td data-action="selectSecond" class="second' + (!this._isValid(currentSecond, 's') ? ' disabled' : '') + '">' + currentSecond.format('ss') + '</td>');
|
2173
|
+
currentSecond.add(5, 's');
|
2174
|
+
}
|
2175
|
+
|
2176
|
+
table.empty().append(html);
|
2177
|
+
};
|
2178
|
+
|
2179
|
+
TempusDominusBootstrap4.prototype._fillTime = function _fillTime() {
|
2180
|
+
var toggle = void 0,
|
2181
|
+
newDate = void 0;
|
2182
|
+
var timeComponents = this.widget.find('.timepicker span[data-time-component]');
|
2183
|
+
|
2184
|
+
if (!this.use24Hours) {
|
2185
|
+
toggle = this.widget.find('.timepicker [data-action=togglePeriod]');
|
2186
|
+
newDate = this._getLastPickedDate().clone().add(this._getLastPickedDate().hours() >= 12 ? -12 : 12, 'h');
|
2187
|
+
|
2188
|
+
toggle.text(this._getLastPickedDate().format('A'));
|
2189
|
+
|
2190
|
+
if (this._isValid(newDate, 'h')) {
|
2191
|
+
toggle.removeClass('disabled');
|
2192
|
+
} else {
|
2193
|
+
toggle.addClass('disabled');
|
2194
|
+
}
|
2195
|
+
}
|
2196
|
+
timeComponents.filter('[data-time-component=hours]').text(this._getLastPickedDate().format('' + (this.use24Hours ? 'HH' : 'hh')));
|
2197
|
+
timeComponents.filter('[data-time-component=minutes]').text(this._getLastPickedDate().format('mm'));
|
2198
|
+
timeComponents.filter('[data-time-component=seconds]').text(this._getLastPickedDate().format('ss'));
|
2199
|
+
|
2200
|
+
this._fillHours();
|
2201
|
+
this._fillMinutes();
|
2202
|
+
this._fillSeconds();
|
2203
|
+
};
|
2204
|
+
|
2205
|
+
TempusDominusBootstrap4.prototype._doAction = function _doAction(e, action) {
|
2206
|
+
var lastPicked = this._getLastPickedDate();
|
2207
|
+
if ($(e.currentTarget).is('.disabled')) {
|
2208
|
+
return false;
|
2209
|
+
}
|
2210
|
+
action = action || $(e.currentTarget).data('action');
|
2211
|
+
switch (action) {
|
2212
|
+
case 'next':
|
2213
|
+
{
|
2214
|
+
var navFnc = DateTimePicker.DatePickerModes[this.currentViewMode].NAV_FUNCTION;
|
2215
|
+
this._viewDate.add(DateTimePicker.DatePickerModes[this.currentViewMode].NAV_STEP, navFnc);
|
2216
|
+
this._fillDate();
|
2217
|
+
this._viewUpdate(navFnc);
|
2218
|
+
break;
|
2219
|
+
}
|
2220
|
+
case 'previous':
|
2221
|
+
{
|
2222
|
+
var _navFnc = DateTimePicker.DatePickerModes[this.currentViewMode].NAV_FUNCTION;
|
2223
|
+
this._viewDate.subtract(DateTimePicker.DatePickerModes[this.currentViewMode].NAV_STEP, _navFnc);
|
2224
|
+
this._fillDate();
|
2225
|
+
this._viewUpdate(_navFnc);
|
2226
|
+
break;
|
2227
|
+
}
|
2228
|
+
case 'pickerSwitch':
|
2229
|
+
this._showMode(1);
|
2230
|
+
break;
|
2231
|
+
case 'selectMonth':
|
2232
|
+
{
|
2233
|
+
var month = $(e.target).closest('tbody').find('span').index($(e.target));
|
2234
|
+
this._viewDate.month(month);
|
2235
|
+
if (this.currentViewMode === this.MinViewModeNumber) {
|
2236
|
+
this._setValue(lastPicked.clone().year(this._viewDate.year()).month(this._viewDate.month()), this._getLastPickedDateIndex());
|
2237
|
+
if (!this._options.inline) {
|
2238
|
+
this.hide();
|
2239
|
+
}
|
2240
|
+
} else {
|
2241
|
+
this._showMode(-1);
|
2242
|
+
this._fillDate();
|
2243
|
+
}
|
2244
|
+
this._viewUpdate('M');
|
2245
|
+
break;
|
2246
|
+
}
|
2247
|
+
case 'selectYear':
|
2248
|
+
{
|
2249
|
+
var year = parseInt($(e.target).text(), 10) || 0;
|
2250
|
+
this._viewDate.year(year);
|
2251
|
+
if (this.currentViewMode === this.MinViewModeNumber) {
|
2252
|
+
this._setValue(lastPicked.clone().year(this._viewDate.year()), this._getLastPickedDateIndex());
|
2253
|
+
if (!this._options.inline) {
|
2254
|
+
this.hide();
|
2255
|
+
}
|
2256
|
+
} else {
|
2257
|
+
this._showMode(-1);
|
2258
|
+
this._fillDate();
|
2259
|
+
}
|
2260
|
+
this._viewUpdate('YYYY');
|
2261
|
+
break;
|
2262
|
+
}
|
2263
|
+
case 'selectDecade':
|
2264
|
+
{
|
2265
|
+
var _year = parseInt($(e.target).data('selection'), 10) || 0;
|
2266
|
+
this._viewDate.year(_year);
|
2267
|
+
if (this.currentViewMode === this.MinViewModeNumber) {
|
2268
|
+
this._setValue(lastPicked.clone().year(this._viewDate.year()), this._getLastPickedDateIndex());
|
2269
|
+
if (!this._options.inline) {
|
2270
|
+
this.hide();
|
2271
|
+
}
|
2272
|
+
} else {
|
2273
|
+
this._showMode(-1);
|
2274
|
+
this._fillDate();
|
2275
|
+
}
|
2276
|
+
this._viewUpdate('YYYY');
|
2277
|
+
break;
|
2278
|
+
}
|
2279
|
+
case 'selectDay':
|
2280
|
+
{
|
2281
|
+
var day = this._viewDate.clone();
|
2282
|
+
if ($(e.target).is('.old')) {
|
2283
|
+
day.subtract(1, 'M');
|
2284
|
+
}
|
2285
|
+
if ($(e.target).is('.new')) {
|
2286
|
+
day.add(1, 'M');
|
2287
|
+
}
|
2288
|
+
|
2289
|
+
var selectDate = day.date(parseInt($(e.target).text(), 10)),
|
2290
|
+
index = 0;
|
2291
|
+
if (this._options.allowMultidate) {
|
2292
|
+
index = this._datesFormatted.indexOf(selectDate.format('YYYY-MM-DD'));
|
2293
|
+
if (index !== -1) {
|
2294
|
+
this._setValue(null, index); //deselect multidate
|
2295
|
+
} else {
|
2296
|
+
this._setValue(selectDate, this._getLastPickedDateIndex() + 1);
|
2297
|
+
}
|
2298
|
+
} else {
|
2299
|
+
this._setValue(selectDate, this._getLastPickedDateIndex());
|
2300
|
+
}
|
2301
|
+
|
2302
|
+
if (!this._hasTime() && !this._options.keepOpen && !this._options.inline && !this._options.allowMultidate) {
|
2303
|
+
this.hide();
|
2304
|
+
}
|
2305
|
+
break;
|
2306
|
+
}
|
2307
|
+
case 'incrementHours':
|
2308
|
+
{
|
2309
|
+
var newDate = lastPicked.clone().add(1, 'h');
|
2310
|
+
if (this._isValid(newDate, 'h')) {
|
2311
|
+
this._setValue(newDate, this._getLastPickedDateIndex());
|
2312
|
+
}
|
2313
|
+
break;
|
2314
|
+
}
|
2315
|
+
case 'incrementMinutes':
|
2316
|
+
{
|
2317
|
+
var _newDate = lastPicked.clone().add(this._options.stepping, 'm');
|
2318
|
+
if (this._isValid(_newDate, 'm')) {
|
2319
|
+
this._setValue(_newDate, this._getLastPickedDateIndex());
|
2320
|
+
}
|
2321
|
+
break;
|
2322
|
+
}
|
2323
|
+
case 'incrementSeconds':
|
2324
|
+
{
|
2325
|
+
var _newDate2 = lastPicked.clone().add(1, 's');
|
2326
|
+
if (this._isValid(_newDate2, 's')) {
|
2327
|
+
this._setValue(_newDate2, this._getLastPickedDateIndex());
|
2328
|
+
}
|
2329
|
+
break;
|
2330
|
+
}
|
2331
|
+
case 'decrementHours':
|
2332
|
+
{
|
2333
|
+
var _newDate3 = lastPicked.clone().subtract(1, 'h');
|
2334
|
+
if (this._isValid(_newDate3, 'h')) {
|
2335
|
+
this._setValue(_newDate3, this._getLastPickedDateIndex());
|
2336
|
+
}
|
2337
|
+
break;
|
2338
|
+
}
|
2339
|
+
case 'decrementMinutes':
|
2340
|
+
{
|
2341
|
+
var _newDate4 = lastPicked.clone().subtract(this._options.stepping, 'm');
|
2342
|
+
if (this._isValid(_newDate4, 'm')) {
|
2343
|
+
this._setValue(_newDate4, this._getLastPickedDateIndex());
|
2344
|
+
}
|
2345
|
+
break;
|
2346
|
+
}
|
2347
|
+
case 'decrementSeconds':
|
2348
|
+
{
|
2349
|
+
var _newDate5 = lastPicked.clone().subtract(1, 's');
|
2350
|
+
if (this._isValid(_newDate5, 's')) {
|
2351
|
+
this._setValue(_newDate5, this._getLastPickedDateIndex());
|
2352
|
+
}
|
2353
|
+
break;
|
2354
|
+
}
|
2355
|
+
case 'togglePeriod':
|
2356
|
+
{
|
2357
|
+
this._setValue(lastPicked.clone().add(lastPicked.hours() >= 12 ? -12 : 12, 'h'), this._getLastPickedDateIndex());
|
2358
|
+
break;
|
2359
|
+
}
|
2360
|
+
case 'togglePicker':
|
2361
|
+
{
|
2362
|
+
var $this = $(e.target),
|
2363
|
+
$link = $this.closest('a'),
|
2364
|
+
$parent = $this.closest('ul'),
|
2365
|
+
expanded = $parent.find('.show'),
|
2366
|
+
closed = $parent.find('.collapse:not(.show)'),
|
2367
|
+
$span = $this.is('span') ? $this : $this.find('span');
|
2368
|
+
var collapseData = void 0;
|
2369
|
+
|
2370
|
+
if (expanded && expanded.length) {
|
2371
|
+
collapseData = expanded.data('collapse');
|
2372
|
+
if (collapseData && collapseData.transitioning) {
|
2373
|
+
return true;
|
2374
|
+
}
|
2375
|
+
if (expanded.collapse) {
|
2376
|
+
// if collapse plugin is available through bootstrap.js then use it
|
2377
|
+
expanded.collapse('hide');
|
2378
|
+
closed.collapse('show');
|
2379
|
+
} else {
|
2380
|
+
// otherwise just toggle in class on the two views
|
2381
|
+
expanded.removeClass('show');
|
2382
|
+
closed.addClass('show');
|
2383
|
+
}
|
2384
|
+
$span.toggleClass(this._options.icons.time + ' ' + this._options.icons.date);
|
2385
|
+
|
2386
|
+
if ($span.hasClass(this._options.icons.date)) {
|
2387
|
+
$link.attr('title', this._options.tooltips.selectDate);
|
2388
|
+
} else {
|
2389
|
+
$link.attr('title', this._options.tooltips.selectTime);
|
2390
|
+
}
|
2391
|
+
}
|
2392
|
+
}
|
2393
|
+
break;
|
2394
|
+
case 'showPicker':
|
2395
|
+
this.widget.find('.timepicker > div:not(.timepicker-picker)').hide();
|
2396
|
+
this.widget.find('.timepicker .timepicker-picker').show();
|
2397
|
+
break;
|
2398
|
+
case 'showHours':
|
2399
|
+
this.widget.find('.timepicker .timepicker-picker').hide();
|
2400
|
+
this.widget.find('.timepicker .timepicker-hours').show();
|
2401
|
+
break;
|
2402
|
+
case 'showMinutes':
|
2403
|
+
this.widget.find('.timepicker .timepicker-picker').hide();
|
2404
|
+
this.widget.find('.timepicker .timepicker-minutes').show();
|
2405
|
+
break;
|
2406
|
+
case 'showSeconds':
|
2407
|
+
this.widget.find('.timepicker .timepicker-picker').hide();
|
2408
|
+
this.widget.find('.timepicker .timepicker-seconds').show();
|
2409
|
+
break;
|
2410
|
+
case 'selectHour':
|
2411
|
+
{
|
2412
|
+
var hour = parseInt($(e.target).text(), 10);
|
2413
|
+
|
2414
|
+
if (!this.use24Hours) {
|
2415
|
+
if (lastPicked.hours() >= 12) {
|
2416
|
+
if (hour !== 12) {
|
2417
|
+
hour += 12;
|
2418
|
+
}
|
2419
|
+
} else {
|
2420
|
+
if (hour === 12) {
|
2421
|
+
hour = 0;
|
2422
|
+
}
|
2423
|
+
}
|
2424
|
+
}
|
2425
|
+
this._setValue(lastPicked.clone().hours(hour), this._getLastPickedDateIndex());
|
2426
|
+
if (!this._isEnabled('a') && !this._isEnabled('m') && !this._options.keepOpen && !this._options.inline) {
|
2427
|
+
this.hide();
|
2428
|
+
} else {
|
2429
|
+
this._doAction(e, 'showPicker');
|
2430
|
+
}
|
2431
|
+
break;
|
2432
|
+
}
|
2433
|
+
case 'selectMinute':
|
2434
|
+
this._setValue(lastPicked.clone().minutes(parseInt($(e.target).text(), 10)), this._getLastPickedDateIndex());
|
2435
|
+
if (!this._isEnabled('a') && !this._isEnabled('s') && !this._options.keepOpen && !this._options.inline) {
|
2436
|
+
this.hide();
|
2437
|
+
} else {
|
2438
|
+
this._doAction(e, 'showPicker');
|
2439
|
+
}
|
2440
|
+
break;
|
2441
|
+
case 'selectSecond':
|
2442
|
+
this._setValue(lastPicked.clone().seconds(parseInt($(e.target).text(), 10)), this._getLastPickedDateIndex());
|
2443
|
+
if (!this._isEnabled('a') && !this._options.keepOpen && !this._options.inline) {
|
2444
|
+
this.hide();
|
2445
|
+
} else {
|
2446
|
+
this._doAction(e, 'showPicker');
|
2447
|
+
}
|
2448
|
+
break;
|
2449
|
+
case 'clear':
|
2450
|
+
this.clear();
|
2451
|
+
break;
|
2452
|
+
case 'close':
|
2453
|
+
this.hide();
|
2454
|
+
break;
|
2455
|
+
case 'today':
|
2456
|
+
{
|
2457
|
+
var todaysDate = this.getMoment();
|
2458
|
+
if (this._isValid(todaysDate, 'd')) {
|
2459
|
+
this._setValue(todaysDate, this._getLastPickedDateIndex());
|
2460
|
+
}
|
2461
|
+
break;
|
2462
|
+
}
|
2463
|
+
}
|
2464
|
+
return false;
|
2465
|
+
};
|
2466
|
+
|
2467
|
+
//public
|
2468
|
+
|
2469
|
+
|
2470
|
+
TempusDominusBootstrap4.prototype.hide = function hide() {
|
2471
|
+
var transitioning = false;
|
2472
|
+
if (!this.widget) {
|
2473
|
+
return;
|
2474
|
+
}
|
2475
|
+
// Ignore event if in the middle of a picker transition
|
2476
|
+
this.widget.find('.collapse').each(function () {
|
2477
|
+
var collapseData = $(this).data('collapse');
|
2478
|
+
if (collapseData && collapseData.transitioning) {
|
2479
|
+
transitioning = true;
|
2480
|
+
return false;
|
2481
|
+
}
|
2482
|
+
return true;
|
2483
|
+
});
|
2484
|
+
if (transitioning) {
|
2485
|
+
return;
|
2486
|
+
}
|
2487
|
+
if (this.component && this.component.hasClass('btn')) {
|
2488
|
+
this.component.toggleClass('active');
|
2489
|
+
}
|
2490
|
+
this.widget.hide();
|
2491
|
+
|
2492
|
+
$(window).off('resize', this._place());
|
2493
|
+
this.widget.off('click', '[data-action]');
|
2494
|
+
this.widget.off('mousedown', false);
|
2495
|
+
|
2496
|
+
this.widget.remove();
|
2497
|
+
this.widget = false;
|
2498
|
+
|
2499
|
+
this._notifyEvent({
|
2500
|
+
type: DateTimePicker.Event.HIDE,
|
2501
|
+
date: this._getLastPickedDate().clone()
|
2502
|
+
});
|
2503
|
+
|
2504
|
+
if (this.input !== undefined) {
|
2505
|
+
this.input.blur();
|
2506
|
+
}
|
2507
|
+
|
2508
|
+
this._viewDate = this._getLastPickedDate().clone();
|
2509
|
+
};
|
2510
|
+
|
2511
|
+
TempusDominusBootstrap4.prototype.show = function show() {
|
2512
|
+
var currentMoment = void 0;
|
2513
|
+
var useCurrentGranularity = {
|
2514
|
+
'year': function year(m) {
|
2515
|
+
return m.month(0).date(1).hours(0).seconds(0).minutes(0);
|
2516
|
+
},
|
2517
|
+
'month': function month(m) {
|
2518
|
+
return m.date(1).hours(0).seconds(0).minutes(0);
|
2519
|
+
},
|
2520
|
+
'day': function day(m) {
|
2521
|
+
return m.hours(0).seconds(0).minutes(0);
|
2522
|
+
},
|
2523
|
+
'hour': function hour(m) {
|
2524
|
+
return m.seconds(0).minutes(0);
|
2525
|
+
},
|
2526
|
+
'minute': function minute(m) {
|
2527
|
+
return m.seconds(0);
|
2528
|
+
}
|
2529
|
+
};
|
2530
|
+
|
2531
|
+
if (this.input !== undefined) {
|
2532
|
+
if (this.input.prop('disabled') || !this._options.ignoreReadonly && this.input.prop('readonly') || this.widget) {
|
2533
|
+
return;
|
2534
|
+
}
|
2535
|
+
if (this.input.val() !== undefined && this.input.val().trim().length !== 0) {
|
2536
|
+
this._setValue(this._parseInputDate(this.input.val().trim()), 0);
|
2537
|
+
} else if (this.unset && this._options.useCurrent) {
|
2538
|
+
currentMoment = this.getMoment();
|
2539
|
+
if (typeof this._options.useCurrent === 'string') {
|
2540
|
+
currentMoment = useCurrentGranularity[this._options.useCurrent](currentMoment);
|
2541
|
+
}
|
2542
|
+
this._setValue(currentMoment, 0);
|
2543
|
+
}
|
2544
|
+
} else if (this.unset && this._options.useCurrent) {
|
2545
|
+
currentMoment = this.getMoment();
|
2546
|
+
if (typeof this._options.useCurrent === 'string') {
|
2547
|
+
currentMoment = useCurrentGranularity[this._options.useCurrent](currentMoment);
|
2548
|
+
}
|
2549
|
+
this._setValue(currentMoment, 0);
|
2550
|
+
}
|
2551
|
+
|
2552
|
+
this.widget = this._getTemplate();
|
2553
|
+
|
2554
|
+
this._fillDow();
|
2555
|
+
this._fillMonths();
|
2556
|
+
|
2557
|
+
this.widget.find('.timepicker-hours').hide();
|
2558
|
+
this.widget.find('.timepicker-minutes').hide();
|
2559
|
+
this.widget.find('.timepicker-seconds').hide();
|
2560
|
+
|
2561
|
+
this._update();
|
2562
|
+
this._showMode();
|
2563
|
+
|
2564
|
+
$(window).on('resize', { picker: this }, this._place);
|
2565
|
+
this.widget.on('click', '[data-action]', $.proxy(this._doAction, this)); // this handles clicks on the widget
|
2566
|
+
this.widget.on('mousedown', false);
|
2567
|
+
|
2568
|
+
if (this.component && this.component.hasClass('btn')) {
|
2569
|
+
this.component.toggleClass('active');
|
2570
|
+
}
|
2571
|
+
this._place();
|
2572
|
+
this.widget.show();
|
2573
|
+
if (this.input !== undefined && this._options.focusOnShow && !this.input.is(':focus')) {
|
2574
|
+
this.input.focus();
|
2575
|
+
}
|
2576
|
+
|
2577
|
+
this._notifyEvent({
|
2578
|
+
type: DateTimePicker.Event.SHOW
|
2579
|
+
});
|
2580
|
+
};
|
2581
|
+
|
2582
|
+
TempusDominusBootstrap4.prototype.destroy = function destroy() {
|
2583
|
+
this.hide();
|
2584
|
+
//todo doc off?
|
2585
|
+
this._element.removeData(DateTimePicker.DATA_KEY);
|
2586
|
+
this._element.removeData('date');
|
2587
|
+
};
|
2588
|
+
|
2589
|
+
TempusDominusBootstrap4.prototype.disable = function disable() {
|
2590
|
+
this.hide();
|
2591
|
+
if (this.component && this.component.hasClass('btn')) {
|
2592
|
+
this.component.addClass('disabled');
|
2593
|
+
}
|
2594
|
+
if (this.input !== undefined) {
|
2595
|
+
this.input.prop('disabled', true); //todo disable this/comp if input is null
|
2596
|
+
}
|
2597
|
+
};
|
2598
|
+
|
2599
|
+
TempusDominusBootstrap4.prototype.enable = function enable() {
|
2600
|
+
if (this.component && this.component.hasClass('btn')) {
|
2601
|
+
this.component.removeClass('disabled');
|
2602
|
+
}
|
2603
|
+
if (this.input !== undefined) {
|
2604
|
+
this.input.prop('disabled', false); //todo enable comp/this if input is null
|
2605
|
+
}
|
2606
|
+
};
|
2607
|
+
|
2608
|
+
TempusDominusBootstrap4.prototype.toolbarPlacement = function toolbarPlacement(_toolbarPlacement) {
|
2609
|
+
if (arguments.length === 0) {
|
2610
|
+
return this._options.toolbarPlacement;
|
2611
|
+
}
|
2612
|
+
|
2613
|
+
if (typeof _toolbarPlacement !== 'string') {
|
2614
|
+
throw new TypeError('toolbarPlacement() expects a string parameter');
|
2615
|
+
}
|
2616
|
+
if (toolbarPlacements.indexOf(_toolbarPlacement) === -1) {
|
2617
|
+
throw new TypeError('toolbarPlacement() parameter must be one of (' + toolbarPlacements.join(', ') + ') value');
|
2618
|
+
}
|
2619
|
+
this._options.toolbarPlacement = _toolbarPlacement;
|
2620
|
+
|
2621
|
+
if (this.widget) {
|
2622
|
+
this.hide();
|
2623
|
+
this.show();
|
2624
|
+
}
|
2625
|
+
};
|
2626
|
+
|
2627
|
+
TempusDominusBootstrap4.prototype.widgetPositioning = function widgetPositioning(_widgetPositioning) {
|
2628
|
+
if (arguments.length === 0) {
|
2629
|
+
return $.extend({}, this._options.widgetPositioning);
|
2630
|
+
}
|
2631
|
+
|
2632
|
+
if ({}.toString.call(_widgetPositioning) !== '[object Object]') {
|
2633
|
+
throw new TypeError('widgetPositioning() expects an object variable');
|
2634
|
+
}
|
2635
|
+
if (_widgetPositioning.horizontal) {
|
2636
|
+
if (typeof _widgetPositioning.horizontal !== 'string') {
|
2637
|
+
throw new TypeError('widgetPositioning() horizontal variable must be a string');
|
2638
|
+
}
|
2639
|
+
_widgetPositioning.horizontal = _widgetPositioning.horizontal.toLowerCase();
|
2640
|
+
if (horizontalModes.indexOf(_widgetPositioning.horizontal) === -1) {
|
2641
|
+
throw new TypeError('widgetPositioning() expects horizontal parameter to be one of (' + horizontalModes.join(', ') + ')');
|
2642
|
+
}
|
2643
|
+
this._options.widgetPositioning.horizontal = _widgetPositioning.horizontal;
|
2644
|
+
}
|
2645
|
+
if (_widgetPositioning.vertical) {
|
2646
|
+
if (typeof _widgetPositioning.vertical !== 'string') {
|
2647
|
+
throw new TypeError('widgetPositioning() vertical variable must be a string');
|
2648
|
+
}
|
2649
|
+
_widgetPositioning.vertical = _widgetPositioning.vertical.toLowerCase();
|
2650
|
+
if (verticalModes.indexOf(_widgetPositioning.vertical) === -1) {
|
2651
|
+
throw new TypeError('widgetPositioning() expects vertical parameter to be one of (' + verticalModes.join(', ') + ')');
|
2652
|
+
}
|
2653
|
+
this._options.widgetPositioning.vertical = _widgetPositioning.vertical;
|
2654
|
+
}
|
2655
|
+
this._update();
|
2656
|
+
};
|
2657
|
+
|
2658
|
+
TempusDominusBootstrap4.prototype.widgetParent = function widgetParent(_widgetParent) {
|
2659
|
+
if (arguments.length === 0) {
|
2660
|
+
return this._options.widgetParent;
|
2661
|
+
}
|
2662
|
+
|
2663
|
+
if (typeof _widgetParent === 'string') {
|
2664
|
+
_widgetParent = $(_widgetParent);
|
2665
|
+
}
|
2666
|
+
|
2667
|
+
if (_widgetParent !== null && typeof _widgetParent !== 'string' && !(_widgetParent instanceof $)) {
|
2668
|
+
throw new TypeError('widgetParent() expects a string or a jQuery object parameter');
|
2669
|
+
}
|
2670
|
+
|
2671
|
+
this._options.widgetParent = _widgetParent;
|
2672
|
+
if (this.widget) {
|
2673
|
+
this.hide();
|
2674
|
+
this.show();
|
2675
|
+
}
|
2676
|
+
};
|
2677
|
+
|
2678
|
+
//static
|
2679
|
+
|
2680
|
+
|
2681
|
+
TempusDominusBootstrap4._jQueryHandleThis = function _jQueryHandleThis(me, option, argument) {
|
2682
|
+
var data = $(me).data(DateTimePicker.DATA_KEY);
|
2683
|
+
if ((typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object') {
|
2684
|
+
$.extend({}, DateTimePicker.Default, option);
|
2685
|
+
}
|
2686
|
+
|
2687
|
+
if (!data) {
|
2688
|
+
data = new TempusDominusBootstrap4($(me), option);
|
2689
|
+
$(me).data(DateTimePicker.DATA_KEY, data);
|
2690
|
+
}
|
2691
|
+
|
2692
|
+
if (typeof option === 'string') {
|
2693
|
+
if (data[option] === undefined) {
|
2694
|
+
throw new Error('No method named "' + option + '"');
|
2695
|
+
}
|
2696
|
+
if (argument === undefined) {
|
2697
|
+
return data[option]();
|
2698
|
+
} else {
|
2699
|
+
return data[option](argument);
|
2700
|
+
}
|
2701
|
+
}
|
2702
|
+
};
|
2703
|
+
|
2704
|
+
TempusDominusBootstrap4._jQueryInterface = function _jQueryInterface(option, argument) {
|
2705
|
+
if (this.length === 1) {
|
2706
|
+
return TempusDominusBootstrap4._jQueryHandleThis(this[0], option, argument);
|
2707
|
+
}
|
2708
|
+
return this.each(function () {
|
2709
|
+
TempusDominusBootstrap4._jQueryHandleThis(this, option, argument);
|
2710
|
+
});
|
2711
|
+
};
|
2712
|
+
|
2713
|
+
return TempusDominusBootstrap4;
|
2714
|
+
}(DateTimePicker);
|
2715
|
+
|
2716
|
+
/**
|
2717
|
+
* ------------------------------------------------------------------------
|
2718
|
+
* jQuery
|
2719
|
+
* ------------------------------------------------------------------------
|
2720
|
+
*/
|
2721
|
+
|
2722
|
+
|
2723
|
+
$(document).on(DateTimePicker.Event.CLICK_DATA_API, DateTimePicker.Selector.DATA_TOGGLE, function () {
|
2724
|
+
var $target = getSelectorFromElement($(this));
|
2725
|
+
if ($target.length === 0) {
|
2726
|
+
return;
|
2727
|
+
}
|
2728
|
+
TempusDominusBootstrap4._jQueryInterface.call($target, 'toggle');
|
2729
|
+
}).on(DateTimePicker.Event.CHANGE, '.' + DateTimePicker.ClassName.INPUT, function (event) {
|
2730
|
+
var $target = getSelectorFromElement($(this));
|
2731
|
+
if ($target.length === 0) {
|
2732
|
+
return;
|
2733
|
+
}
|
2734
|
+
TempusDominusBootstrap4._jQueryInterface.call($target, '_change', event);
|
2735
|
+
}).on(DateTimePicker.Event.BLUR, '.' + DateTimePicker.ClassName.INPUT, function (event) {
|
2736
|
+
var $target = getSelectorFromElement($(this)),
|
2737
|
+
config = $target.data(DateTimePicker.DATA_KEY);
|
2738
|
+
if ($target.length === 0) {
|
2739
|
+
return;
|
2740
|
+
}
|
2741
|
+
if (config._options.debug || window.debug) {
|
2742
|
+
return;
|
2743
|
+
}
|
2744
|
+
TempusDominusBootstrap4._jQueryInterface.call($target, 'hide', event);
|
2745
|
+
}).on(DateTimePicker.Event.KEYDOWN, '.' + DateTimePicker.ClassName.INPUT, function (event) {
|
2746
|
+
var $target = getSelectorFromElement($(this));
|
2747
|
+
if ($target.length === 0) {
|
2748
|
+
return;
|
2749
|
+
}
|
2750
|
+
TempusDominusBootstrap4._jQueryInterface.call($target, '_keydown', event);
|
2751
|
+
}).on(DateTimePicker.Event.KEYUP, '.' + DateTimePicker.ClassName.INPUT, function (event) {
|
2752
|
+
var $target = getSelectorFromElement($(this));
|
2753
|
+
if ($target.length === 0) {
|
2754
|
+
return;
|
2755
|
+
}
|
2756
|
+
TempusDominusBootstrap4._jQueryInterface.call($target, '_keyup', event);
|
2757
|
+
}).on(DateTimePicker.Event.FOCUS, '.' + DateTimePicker.ClassName.INPUT, function (event) {
|
2758
|
+
var $target = getSelectorFromElement($(this)),
|
2759
|
+
config = $target.data(DateTimePicker.DATA_KEY);
|
2760
|
+
if ($target.length === 0) {
|
2761
|
+
return;
|
2762
|
+
}
|
2763
|
+
if (!config._options.allowInputToggle) {
|
2764
|
+
return;
|
2765
|
+
}
|
2766
|
+
TempusDominusBootstrap4._jQueryInterface.call($target, 'show', event);
|
2767
|
+
});
|
2768
|
+
|
2769
|
+
$.fn[DateTimePicker.NAME] = TempusDominusBootstrap4._jQueryInterface;
|
2770
|
+
$.fn[DateTimePicker.NAME].Constructor = TempusDominusBootstrap4;
|
2771
|
+
$.fn[DateTimePicker.NAME].noConflict = function () {
|
2772
|
+
$.fn[DateTimePicker.NAME] = JQUERY_NO_CONFLICT;
|
2773
|
+
return TempusDominusBootstrap4._jQueryInterface;
|
2774
|
+
};
|
2775
|
+
|
2776
|
+
return TempusDominusBootstrap4;
|
2777
|
+
}(jQuery);
|
2778
|
+
|
2779
|
+
}();
|