action_ui 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (386) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +36 -0
  3. data/lib/cre_pro-rails.rb +8 -0
  4. data/lib/cre_pro/rails.rb +7 -0
  5. data/lib/cre_pro/rails/version.rb +5 -0
  6. data/vendor/assets/javascripts/gp/gp.js +292 -0
  7. data/vendor/assets/javascripts/ld/bootstrap-checkbox-radio-switch-tags.js +869 -0
  8. data/vendor/assets/javascripts/ld/bootstrap-datetimepicker.js +2573 -0
  9. data/vendor/assets/javascripts/ld/bootstrap-notify.js +379 -0
  10. data/vendor/assets/javascripts/ld/bootstrap-selectpicker.js +1711 -0
  11. data/vendor/assets/javascripts/ld/bootstrap-table.js +2484 -0
  12. data/vendor/assets/javascripts/ld/chartist.min.js +8 -0
  13. data/vendor/assets/javascripts/ld/demo.js +731 -0
  14. data/vendor/assets/javascripts/ld/fullcalendar.min.js +9 -0
  15. data/vendor/assets/javascripts/ld/jquery-jvectormap.js +3381 -0
  16. data/vendor/assets/javascripts/ld/jquery-ui.min.js +24 -0
  17. data/vendor/assets/javascripts/ld/jquery.bootstrap.wizard.min.js +22 -0
  18. data/vendor/assets/javascripts/ld/jquery.datatables.js +15498 -0
  19. data/vendor/assets/javascripts/ld/jquery.min.js +5 -0
  20. data/vendor/assets/javascripts/ld/jquery.validate.min.js +4 -0
  21. data/vendor/assets/javascripts/ld/ld.js +422 -0
  22. data/vendor/assets/javascripts/ld/moment.min.js +7 -0
  23. data/vendor/assets/javascripts/ld/sweetalert2.js +877 -0
  24. data/vendor/assets/javascripts/mk/bootstrap-datepicker.js +474 -0
  25. data/vendor/assets/javascripts/mk/bootstrap.min.js +7 -0
  26. data/vendor/assets/javascripts/mk/jasny-bootstrap.min.js +6 -0
  27. data/vendor/assets/javascripts/mk/jquery.dropdown.js +378 -0
  28. data/vendor/assets/javascripts/mk/jquery.flexisel.js +342 -0
  29. data/vendor/assets/javascripts/mk/jquery.min.js +3 -0
  30. data/vendor/assets/javascripts/mk/jquery.tagsinput.js +355 -0
  31. data/vendor/assets/javascripts/mk/mk.js +191 -0
  32. data/vendor/assets/javascripts/mk/mk.min.js +1 -0
  33. data/vendor/assets/javascripts/mk/nouislider.min.js +31 -0
  34. data/vendor/assets/javascripts/pd/bootstrap-checkbox-radio-switch-tags.js +869 -0
  35. data/vendor/assets/javascripts/pd/bootstrap-datetimepicker.js +2576 -0
  36. data/vendor/assets/javascripts/pd/bootstrap-notify.js +379 -0
  37. data/vendor/assets/javascripts/pd/bootstrap-selectpicker.js +1711 -0
  38. data/vendor/assets/javascripts/pd/bootstrap-table.js +2484 -0
  39. data/vendor/assets/javascripts/pd/bootstrap.min.js +12 -0
  40. data/vendor/assets/javascripts/pd/chartist.min.js +9 -0
  41. data/vendor/assets/javascripts/pd/demo.js +911 -0
  42. data/vendor/assets/javascripts/pd/fullcalendar.min.js +9 -0
  43. data/vendor/assets/javascripts/pd/jquery-1.10.2.js +9789 -0
  44. data/vendor/assets/javascripts/pd/jquery-1.10.2.min.js +3 -0
  45. data/vendor/assets/javascripts/pd/jquery-jvectormap.js +3381 -0
  46. data/vendor/assets/javascripts/pd/jquery-ui.min.js +24 -0
  47. data/vendor/assets/javascripts/pd/jquery.bootstrap.wizard.min.js +22 -0
  48. data/vendor/assets/javascripts/pd/jquery.datatables.js +15498 -0
  49. data/vendor/assets/javascripts/pd/jquery.easypiechart.min.js +9 -0
  50. data/vendor/assets/javascripts/pd/jquery.min.js +5 -0
  51. data/vendor/assets/javascripts/pd/jquery.tagsinput.js +355 -0
  52. data/vendor/assets/javascripts/pd/jquery.validate.min.js +4 -0
  53. data/vendor/assets/javascripts/pd/moment.min.js +7 -0
  54. data/vendor/assets/javascripts/pd/pd.js +335 -0
  55. data/vendor/assets/javascripts/pd/sweetalert2.js +877 -0
  56. data/vendor/assets/javascripts/pk/bootstrap-datepicker.js +492 -0
  57. data/vendor/assets/javascripts/pk/bootstrap-select.js +1711 -0
  58. data/vendor/assets/javascripts/pk/chartist.min.js +8 -0
  59. data/vendor/assets/javascripts/pk/ct-pk-bootstrapswitch.js +249 -0
  60. data/vendor/assets/javascripts/pk/ct-pk-checkbox.js +109 -0
  61. data/vendor/assets/javascripts/pk/ct-pk-radio.js +140 -0
  62. data/vendor/assets/javascripts/pk/ct-pk.js +305 -0
  63. data/vendor/assets/javascripts/pk/demo.js +289 -0
  64. data/vendor/assets/javascripts/pk/jasny-bootstrap.min.js +6 -0
  65. data/vendor/assets/javascripts/pk/jquery-1.10.2.js +9789 -0
  66. data/vendor/assets/javascripts/pk/jquery-ui-1.10.4.custom.min.js +6 -0
  67. data/vendor/assets/javascripts/pk/jquery.tagsinput.js +355 -0
  68. data/vendor/assets/javascripts/pk/photo_swipe/init-gallery.js +205 -0
  69. data/vendor/assets/javascripts/pk/photo_swipe/photoswipe-ui-default.min.js +4 -0
  70. data/vendor/assets/javascripts/pk/photo_swipe/photoswipe.min.js +4 -0
  71. data/vendor/assets/javascripts/pk/presentation-page/atv-img-min.js +233 -0
  72. data/vendor/assets/javascripts/pk/presentation-page/jquery.sharrre.js +585 -0
  73. data/vendor/assets/javascripts/sd/bootstrap-datepicker.js +492 -0
  74. data/vendor/assets/javascripts/sd/bootstrap-select.js +1711 -0
  75. data/vendor/assets/javascripts/sd/chartist.min.js +8 -0
  76. data/vendor/assets/javascripts/sd/demo.js +227 -0
  77. data/vendor/assets/javascripts/sd/jquery-ui.custom.min.js +7 -0
  78. data/vendor/assets/javascripts/sd/jquery.flexisel.js +342 -0
  79. data/vendor/assets/javascripts/sd/jquery.js +9789 -0
  80. data/vendor/assets/javascripts/sd/jquery.tagsinput.js +355 -0
  81. data/vendor/assets/javascripts/sd/retina.min.js +10 -0
  82. data/vendor/assets/javascripts/sd/sd-bootstrapswitch.js +249 -0
  83. data/vendor/assets/javascripts/sd/sd-checkbox.js +109 -0
  84. data/vendor/assets/javascripts/sd/sd-morphing.js +89 -0
  85. data/vendor/assets/javascripts/sd/sd-radio.js +140 -0
  86. data/vendor/assets/javascripts/sd/sd.js +398 -0
  87. data/vendor/assets/stylesheets/gp/components/_buttons.scss +121 -0
  88. data/vendor/assets/stylesheets/gp/components/_cards.scss +271 -0
  89. data/vendor/assets/stylesheets/gp/components/_carousel.scss +15 -0
  90. data/vendor/assets/stylesheets/gp/components/_clients.scss +172 -0
  91. data/vendor/assets/stylesheets/gp/components/_closure.scss +19 -0
  92. data/vendor/assets/stylesheets/gp/components/_contact.scss +93 -0
  93. data/vendor/assets/stylesheets/gp/components/_dropdown.scss +173 -0
  94. data/vendor/assets/stylesheets/gp/components/_example-pages.scss +524 -0
  95. data/vendor/assets/stylesheets/gp/components/_footers.scss +191 -0
  96. data/vendor/assets/stylesheets/gp/components/_headers.scss +72 -0
  97. data/vendor/assets/stylesheets/gp/components/_inputs.scss +145 -0
  98. data/vendor/assets/stylesheets/gp/components/_labels.scss +15 -0
  99. data/vendor/assets/stylesheets/gp/components/_misc.scss +332 -0
  100. data/vendor/assets/stylesheets/gp/components/_mixins.scss +11 -0
  101. data/vendor/assets/stylesheets/gp/components/_navbars.scss +252 -0
  102. data/vendor/assets/stylesheets/gp/components/_numbers.scss +61 -0
  103. data/vendor/assets/stylesheets/gp/components/_projects.scss +279 -0
  104. data/vendor/assets/stylesheets/gp/components/_responsive.scss +950 -0
  105. data/vendor/assets/stylesheets/gp/components/_sections.scss +328 -0
  106. data/vendor/assets/stylesheets/gp/components/_social-buttons.scss +30 -0
  107. data/vendor/assets/stylesheets/gp/components/_team.scss +182 -0
  108. data/vendor/assets/stylesheets/gp/components/_theme.scss +22 -0
  109. data/vendor/assets/stylesheets/gp/components/_typography.scss +252 -0
  110. data/vendor/assets/stylesheets/gp/components/_variables.scss +267 -0
  111. data/vendor/assets/stylesheets/gp/components/mixins/_buttons.scss +61 -0
  112. data/vendor/assets/stylesheets/gp/components/mixins/_cards.scss +8 -0
  113. data/vendor/assets/stylesheets/gp/components/mixins/_inputs.scss +17 -0
  114. data/vendor/assets/stylesheets/gp/components/mixins/_navbars.scss +11 -0
  115. data/vendor/assets/stylesheets/gp/components/mixins/_transparency.scss +20 -0
  116. data/vendor/assets/stylesheets/gp/components/mixins/_vendor-prefixes.scss +284 -0
  117. data/vendor/assets/stylesheets/gp/gp.scss +30 -0
  118. data/vendor/assets/stylesheets/ld/ld.scss +53 -0
  119. data/vendor/assets/stylesheets/ld/ld/_alerts.scss +82 -0
  120. data/vendor/assets/stylesheets/ld/ld/_buttons.scss +123 -0
  121. data/vendor/assets/stylesheets/ld/ld/_cards.scss +315 -0
  122. data/vendor/assets/stylesheets/ld/ld/_carousel.scss +15 -0
  123. data/vendor/assets/stylesheets/ld/ld/_checkbox-radio-switch.scss +253 -0
  124. data/vendor/assets/stylesheets/ld/ld/_collapse.scss +49 -0
  125. data/vendor/assets/stylesheets/ld/ld/_dropdown.scss +176 -0
  126. data/vendor/assets/stylesheets/ld/ld/_footers.scss +155 -0
  127. data/vendor/assets/stylesheets/ld/ld/_forms.scss +41 -0
  128. data/vendor/assets/stylesheets/ld/ld/_inputs.scss +170 -0
  129. data/vendor/assets/stylesheets/ld/ld/_labels.scss +54 -0
  130. data/vendor/assets/stylesheets/ld/ld/_media.scss +80 -0
  131. data/vendor/assets/stylesheets/ld/ld/_misc.scss +87 -0
  132. data/vendor/assets/stylesheets/ld/ld/_mixins.scss +22 -0
  133. data/vendor/assets/stylesheets/ld/ld/_modal.scss +79 -0
  134. data/vendor/assets/stylesheets/ld/ld/_navbars.scss +362 -0
  135. data/vendor/assets/stylesheets/ld/ld/_pages.scss +215 -0
  136. data/vendor/assets/stylesheets/ld/ld/_progress-bars.scss +26 -0
  137. data/vendor/assets/stylesheets/ld/ld/_responsive.scss +647 -0
  138. data/vendor/assets/stylesheets/ld/ld/_sidebar-and-main-panel.scss +576 -0
  139. data/vendor/assets/stylesheets/ld/ld/_sliders.scss +219 -0
  140. data/vendor/assets/stylesheets/ld/ld/_social-buttons.scss +77 -0
  141. data/vendor/assets/stylesheets/ld/ld/_tables.scss +120 -0
  142. data/vendor/assets/stylesheets/ld/ld/_tabs-navs-pagination.scss +302 -0
  143. data/vendor/assets/stylesheets/ld/ld/_tags.scss +123 -0
  144. data/vendor/assets/stylesheets/ld/ld/_tooltips-and-popovers.scss +156 -0
  145. data/vendor/assets/stylesheets/ld/ld/_typography.scss +93 -0
  146. data/vendor/assets/stylesheets/ld/ld/_variables.scss +319 -0
  147. data/vendor/assets/stylesheets/ld/ld/mixins/_buttons.scss +74 -0
  148. data/vendor/assets/stylesheets/ld/ld/mixins/_cards.scss +8 -0
  149. data/vendor/assets/stylesheets/ld/ld/mixins/_chartist.scss +85 -0
  150. data/vendor/assets/stylesheets/ld/ld/mixins/_icons.scss +13 -0
  151. data/vendor/assets/stylesheets/ld/ld/mixins/_inputs.scss +17 -0
  152. data/vendor/assets/stylesheets/ld/ld/mixins/_labels.scss +21 -0
  153. data/vendor/assets/stylesheets/ld/ld/mixins/_morphing-buttons.scss +34 -0
  154. data/vendor/assets/stylesheets/ld/ld/mixins/_navbars.scss +11 -0
  155. data/vendor/assets/stylesheets/ld/ld/mixins/_social-buttons.scss +43 -0
  156. data/vendor/assets/stylesheets/ld/ld/mixins/_table-row.scss +22 -0
  157. data/vendor/assets/stylesheets/ld/ld/mixins/_tabs.scss +4 -0
  158. data/vendor/assets/stylesheets/ld/ld/mixins/_transparency.scss +20 -0
  159. data/vendor/assets/stylesheets/ld/ld/mixins/_vendor-prefixes.scss +197 -0
  160. data/vendor/assets/stylesheets/ld/ld/plugins/_animate.scss +188 -0
  161. data/vendor/assets/stylesheets/ld/ld/plugins/_bootstrap-select.scss +308 -0
  162. data/vendor/assets/stylesheets/ld/ld/plugins/_bootstrap-table.scss +328 -0
  163. data/vendor/assets/stylesheets/ld/ld/plugins/_chartist.scss +247 -0
  164. data/vendor/assets/stylesheets/ld/ld/plugins/_datatables.net.scss +513 -0
  165. data/vendor/assets/stylesheets/ld/ld/plugins/_datetime-picker.scss +440 -0
  166. data/vendor/assets/stylesheets/ld/ld/plugins/_fullcalendar.scss +1114 -0
  167. data/vendor/assets/stylesheets/ld/ld/plugins/_jquery.jvectormap.scss +135 -0
  168. data/vendor/assets/stylesheets/ld/ld/plugins/_perfect-scrollbar.scss +111 -0
  169. data/vendor/assets/stylesheets/ld/ld/plugins/_sweetalert2.scss +531 -0
  170. data/vendor/assets/stylesheets/mk/mk.scss +50 -0
  171. data/vendor/assets/stylesheets/mk/mk/_alerts.scss +41 -0
  172. data/vendor/assets/stylesheets/mk/mk/_buttons.scss +283 -0
  173. data/vendor/assets/stylesheets/mk/mk/_cards.scss +576 -0
  174. data/vendor/assets/stylesheets/mk/mk/_carousel.scss +86 -0
  175. data/vendor/assets/stylesheets/mk/mk/_checkboxes.scss +195 -0
  176. data/vendor/assets/stylesheets/mk/mk/_colors.scss +326 -0
  177. data/vendor/assets/stylesheets/mk/mk/_dialogs.scss +99 -0
  178. data/vendor/assets/stylesheets/mk/mk/_dividers.scss +73 -0
  179. data/vendor/assets/stylesheets/mk/mk/_dropdown.scss +86 -0
  180. data/vendor/assets/stylesheets/mk/mk/_example-pages.scss +775 -0
  181. data/vendor/assets/stylesheets/mk/mk/_fileupload.scss +115 -0
  182. data/vendor/assets/stylesheets/mk/mk/_flexisel.scss +54 -0
  183. data/vendor/assets/stylesheets/mk/mk/_form.scss +58 -0
  184. data/vendor/assets/stylesheets/mk/mk/_images.scss +6 -0
  185. data/vendor/assets/stylesheets/mk/mk/_import-bs-less.scss +4 -0
  186. data/vendor/assets/stylesheets/mk/mk/_import-bs-sass.scss +2 -0
  187. data/vendor/assets/stylesheets/mk/mk/_info-areas.scss +57 -0
  188. data/vendor/assets/stylesheets/mk/mk/_inputs-size.scss +223 -0
  189. data/vendor/assets/stylesheets/mk/mk/_inputs.scss +394 -0
  190. data/vendor/assets/stylesheets/mk/mk/_labels.scss +10 -0
  191. data/vendor/assets/stylesheets/mk/mk/_lists.scss +104 -0
  192. data/vendor/assets/stylesheets/mk/mk/_media.scss +47 -0
  193. data/vendor/assets/stylesheets/mk/mk/_misc.scss +94 -0
  194. data/vendor/assets/stylesheets/mk/mk/_mixins.scss +413 -0
  195. data/vendor/assets/stylesheets/mk/mk/_navbar.scss +311 -0
  196. data/vendor/assets/stylesheets/mk/mk/_pagination.scss +91 -0
  197. data/vendor/assets/stylesheets/mk/mk/_panels.scss +47 -0
  198. data/vendor/assets/stylesheets/mk/mk/_pills.scss +128 -0
  199. data/vendor/assets/stylesheets/mk/mk/_popups.scss +77 -0
  200. data/vendor/assets/stylesheets/mk/mk/_progress.scss +33 -0
  201. data/vendor/assets/stylesheets/mk/mk/_radios.scss +114 -0
  202. data/vendor/assets/stylesheets/mk/mk/_responsive.scss +115 -0
  203. data/vendor/assets/stylesheets/mk/mk/_ripples.scss +40 -0
  204. data/vendor/assets/stylesheets/mk/mk/_sections.scss +131 -0
  205. data/vendor/assets/stylesheets/mk/mk/_select.scss +108 -0
  206. data/vendor/assets/stylesheets/mk/mk/_shadows.scss +138 -0
  207. data/vendor/assets/stylesheets/mk/mk/_tables.scss +104 -0
  208. data/vendor/assets/stylesheets/mk/mk/_tabs.scss +53 -0
  209. data/vendor/assets/stylesheets/mk/mk/_tags.scss +97 -0
  210. data/vendor/assets/stylesheets/mk/mk/_togglebutton.scss +87 -0
  211. data/vendor/assets/stylesheets/mk/mk/_typography.scss +75 -0
  212. data/vendor/assets/stylesheets/mk/mk/_variables.scss +224 -0
  213. data/vendor/assets/stylesheets/mk/mk/_variables_bootstrap.scss +883 -0
  214. data/vendor/assets/stylesheets/mk/mk/_welljumbo.scss +28 -0
  215. data/vendor/assets/stylesheets/mk/mk/plugins/_plugin-datepicker.scss +204 -0
  216. data/vendor/assets/stylesheets/mk/mk/plugins/_plugin-nouislider.scss +161 -0
  217. data/vendor/assets/stylesheets/mk/mk/plugins/_plugin-selectize.scss +93 -0
  218. data/vendor/assets/stylesheets/mk/mk/plugins/_plugin-snackbarjs.scss +34 -0
  219. data/vendor/assets/stylesheets/mk/mk/sections/_blogs.scss +17 -0
  220. data/vendor/assets/stylesheets/mk/mk/sections/_contactus.scss +51 -0
  221. data/vendor/assets/stylesheets/mk/mk/sections/_features.scss +92 -0
  222. data/vendor/assets/stylesheets/mk/mk/sections/_footers.scss +163 -0
  223. data/vendor/assets/stylesheets/mk/mk/sections/_headers.scss +125 -0
  224. data/vendor/assets/stylesheets/mk/mk/sections/_pricing.scss +40 -0
  225. data/vendor/assets/stylesheets/mk/mk/sections/_projects.scss +75 -0
  226. data/vendor/assets/stylesheets/mk/mk/sections/_social-subscribe-lines.scss +71 -0
  227. data/vendor/assets/stylesheets/mk/mk/sections/_team.scss +53 -0
  228. data/vendor/assets/stylesheets/mk/mk/sections/_testimonials.scss +5 -0
  229. data/vendor/assets/stylesheets/pd/pd.scss +51 -0
  230. data/vendor/assets/stylesheets/pd/pd/_alerts.scss +60 -0
  231. data/vendor/assets/stylesheets/pd/pd/_animated-buttons.scss +61 -0
  232. data/vendor/assets/stylesheets/pd/pd/_buttons.scss +173 -0
  233. data/vendor/assets/stylesheets/pd/pd/_cards.scss +546 -0
  234. data/vendor/assets/stylesheets/pd/pd/_carousel.scss +15 -0
  235. data/vendor/assets/stylesheets/pd/pd/_chat-message.scss +206 -0
  236. data/vendor/assets/stylesheets/pd/pd/_checkbox-radio.scss +126 -0
  237. data/vendor/assets/stylesheets/pd/pd/_circlechart.scss +18 -0
  238. data/vendor/assets/stylesheets/pd/pd/_collapse.scss +40 -0
  239. data/vendor/assets/stylesheets/pd/pd/_dropdown.scss +413 -0
  240. data/vendor/assets/stylesheets/pd/pd/_footers.scss +87 -0
  241. data/vendor/assets/stylesheets/pd/pd/_forms.scss +43 -0
  242. data/vendor/assets/stylesheets/pd/pd/_inputs.scss +190 -0
  243. data/vendor/assets/stylesheets/pd/pd/_labels.scss +29 -0
  244. data/vendor/assets/stylesheets/pd/pd/_media.scss +80 -0
  245. data/vendor/assets/stylesheets/pd/pd/_misc.scss +104 -0
  246. data/vendor/assets/stylesheets/pd/pd/_mixins.scss +17 -0
  247. data/vendor/assets/stylesheets/pd/pd/_modal.scss +79 -0
  248. data/vendor/assets/stylesheets/pd/pd/_navbars.scss +289 -0
  249. data/vendor/assets/stylesheets/pd/pd/_pages.scss +196 -0
  250. data/vendor/assets/stylesheets/pd/pd/_progress-bars.scss +27 -0
  251. data/vendor/assets/stylesheets/pd/pd/_responsive.scss +666 -0
  252. data/vendor/assets/stylesheets/pd/pd/_sidebar-and-main-panel.scss +514 -0
  253. data/vendor/assets/stylesheets/pd/pd/_sliders.scss +222 -0
  254. data/vendor/assets/stylesheets/pd/pd/_social.scss +130 -0
  255. data/vendor/assets/stylesheets/pd/pd/_switch.scss +145 -0
  256. data/vendor/assets/stylesheets/pd/pd/_tables.scss +194 -0
  257. data/vendor/assets/stylesheets/pd/pd/_tabs-navs-pagination.scss +341 -0
  258. data/vendor/assets/stylesheets/pd/pd/_tags.scss +104 -0
  259. data/vendor/assets/stylesheets/pd/pd/_timeline.scss +178 -0
  260. data/vendor/assets/stylesheets/pd/pd/_tooltips-and-popovers.scss +156 -0
  261. data/vendor/assets/stylesheets/pd/pd/_typography.scss +117 -0
  262. data/vendor/assets/stylesheets/pd/pd/_variables.scss +367 -0
  263. data/vendor/assets/stylesheets/pd/pd/mixins/_alerts.scss +13 -0
  264. data/vendor/assets/stylesheets/pd/pd/mixins/_buttons.scss +89 -0
  265. data/vendor/assets/stylesheets/pd/pd/mixins/_cards.scss +7 -0
  266. data/vendor/assets/stylesheets/pd/pd/mixins/_chartist.scss +104 -0
  267. data/vendor/assets/stylesheets/pd/pd/mixins/_icons.scss +13 -0
  268. data/vendor/assets/stylesheets/pd/pd/mixins/_inputs.scss +17 -0
  269. data/vendor/assets/stylesheets/pd/pd/mixins/_labels.scss +10 -0
  270. data/vendor/assets/stylesheets/pd/pd/mixins/_navbars.scss +11 -0
  271. data/vendor/assets/stylesheets/pd/pd/mixins/_sidebar.scss +54 -0
  272. data/vendor/assets/stylesheets/pd/pd/mixins/_social.scss +68 -0
  273. data/vendor/assets/stylesheets/pd/pd/mixins/_table-row.scss +22 -0
  274. data/vendor/assets/stylesheets/pd/pd/mixins/_tabs.scss +4 -0
  275. data/vendor/assets/stylesheets/pd/pd/mixins/_transparency.scss +20 -0
  276. data/vendor/assets/stylesheets/pd/pd/mixins/_vendor-prefixes.scss +254 -0
  277. data/vendor/assets/stylesheets/pd/pd/plugins/_animate.scss +189 -0
  278. data/vendor/assets/stylesheets/pd/pd/plugins/_bootstrap-select.scss +313 -0
  279. data/vendor/assets/stylesheets/pd/pd/plugins/_bootstrap-table.scss +375 -0
  280. data/vendor/assets/stylesheets/pd/pd/plugins/_chartist.scss +246 -0
  281. data/vendor/assets/stylesheets/pd/pd/plugins/_datatables.net.scss +504 -0
  282. data/vendor/assets/stylesheets/pd/pd/plugins/_datetime-picker.scss +418 -0
  283. data/vendor/assets/stylesheets/pd/pd/plugins/_fullcalendar.scss +1124 -0
  284. data/vendor/assets/stylesheets/pd/pd/plugins/_jquery.jvectormap.scss +135 -0
  285. data/vendor/assets/stylesheets/pd/pd/plugins/_perfect-scrollbar.scss +112 -0
  286. data/vendor/assets/stylesheets/pd/pd/plugins/_sweetalert2.scss +531 -0
  287. data/vendor/assets/stylesheets/pk/ct-pk.scss +64 -0
  288. data/vendor/assets/stylesheets/pk/ct-pk/_alerts.scss +69 -0
  289. data/vendor/assets/stylesheets/pk/ct-pk/_animated-buttons.scss +63 -0
  290. data/vendor/assets/stylesheets/pk/ct-pk/_bootstrap-select.scss +320 -0
  291. data/vendor/assets/stylesheets/pk/ct-pk/_buttons.scss +161 -0
  292. data/vendor/assets/stylesheets/pk/ct-pk/_cards.scss +570 -0
  293. data/vendor/assets/stylesheets/pk/ct-pk/_carousel.scss +59 -0
  294. data/vendor/assets/stylesheets/pk/ct-pk/_chartist.scss +354 -0
  295. data/vendor/assets/stylesheets/pk/ct-pk/_checkbox-radio.scss +129 -0
  296. data/vendor/assets/stylesheets/pk/ct-pk/_collapse.scss +40 -0
  297. data/vendor/assets/stylesheets/pk/ct-pk/_datepicker.scss +198 -0
  298. data/vendor/assets/stylesheets/pk/ct-pk/_dropdown.scss +291 -0
  299. data/vendor/assets/stylesheets/pk/ct-pk/_fileupload.scss +112 -0
  300. data/vendor/assets/stylesheets/pk/ct-pk/_footers.scss +193 -0
  301. data/vendor/assets/stylesheets/pk/ct-pk/_headers.scss +85 -0
  302. data/vendor/assets/stylesheets/pk/ct-pk/_images.scss +28 -0
  303. data/vendor/assets/stylesheets/pk/ct-pk/_info-areas.scss +62 -0
  304. data/vendor/assets/stylesheets/pk/ct-pk/_inputs.scss +171 -0
  305. data/vendor/assets/stylesheets/pk/ct-pk/_labels.scss +29 -0
  306. data/vendor/assets/stylesheets/pk/ct-pk/_media.scss +82 -0
  307. data/vendor/assets/stylesheets/pk/ct-pk/_misc.scss +124 -0
  308. data/vendor/assets/stylesheets/pk/ct-pk/_mixins.scss +16 -0
  309. data/vendor/assets/stylesheets/pk/ct-pk/_modal.scss +91 -0
  310. data/vendor/assets/stylesheets/pk/ct-pk/_navbars.scss +285 -0
  311. data/vendor/assets/stylesheets/pk/ct-pk/_preloaders.scss +282 -0
  312. data/vendor/assets/stylesheets/pk/ct-pk/_progress-bars.scss +27 -0
  313. data/vendor/assets/stylesheets/pk/ct-pk/_responsive.scss +411 -0
  314. data/vendor/assets/stylesheets/pk/ct-pk/_sections.scss +45 -0
  315. data/vendor/assets/stylesheets/pk/ct-pk/_sidebar.scss +206 -0
  316. data/vendor/assets/stylesheets/pk/ct-pk/_sliders.scss +222 -0
  317. data/vendor/assets/stylesheets/pk/ct-pk/_social.scss +130 -0
  318. data/vendor/assets/stylesheets/pk/ct-pk/_switch.scss +145 -0
  319. data/vendor/assets/stylesheets/pk/ct-pk/_tables.scss +135 -0
  320. data/vendor/assets/stylesheets/pk/ct-pk/_tabs-navs-pagination.scss +311 -0
  321. data/vendor/assets/stylesheets/pk/ct-pk/_tags.scss +108 -0
  322. data/vendor/assets/stylesheets/pk/ct-pk/_tooltips-and-popovers.scss +188 -0
  323. data/vendor/assets/stylesheets/pk/ct-pk/_typography.scss +106 -0
  324. data/vendor/assets/stylesheets/pk/ct-pk/_variables.scss +301 -0
  325. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_alerts.scss +11 -0
  326. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_buttons.scss +104 -0
  327. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_inputs.scss +17 -0
  328. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_labels.scss +10 -0
  329. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_navbars.scss +11 -0
  330. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_popovers.scss +21 -0
  331. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_social.scss +68 -0
  332. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_tabs.scss +4 -0
  333. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_transparency.scss +17 -0
  334. data/vendor/assets/stylesheets/pk/ct-pk/mixins/_vendor-prefixes.scss +233 -0
  335. data/vendor/assets/stylesheets/pk/ct-pk/plugins/photo-swipe/_default-skin.scss +592 -0
  336. data/vendor/assets/stylesheets/pk/ct-pk/plugins/photo-swipe/_gallery.scss +27 -0
  337. data/vendor/assets/stylesheets/pk/ct-pk/plugins/photo-swipe/_main-settings.scss +11 -0
  338. data/vendor/assets/stylesheets/pk/ct-pk/plugins/photo-swipe/_main.scss +213 -0
  339. data/vendor/assets/stylesheets/pk/examples.scss +1083 -0
  340. data/vendor/assets/stylesheets/sd/examples.scss +403 -0
  341. data/vendor/assets/stylesheets/sd/sd.scss +41 -0
  342. data/vendor/assets/stylesheets/sd/sd/_alerts.scss +37 -0
  343. data/vendor/assets/stylesheets/sd/sd/_bootstrap-select.scss +307 -0
  344. data/vendor/assets/stylesheets/sd/sd/_buttons.scss +108 -0
  345. data/vendor/assets/stylesheets/sd/sd/_cards.scss +462 -0
  346. data/vendor/assets/stylesheets/sd/sd/_carousel.scss +15 -0
  347. data/vendor/assets/stylesheets/sd/sd/_chartist.scss +335 -0
  348. data/vendor/assets/stylesheets/sd/sd/_checkbox-radio-switch.scss +246 -0
  349. data/vendor/assets/stylesheets/sd/sd/_collapse.scss +33 -0
  350. data/vendor/assets/stylesheets/sd/sd/_datepicker.scss +199 -0
  351. data/vendor/assets/stylesheets/sd/sd/_dropdown.scss +98 -0
  352. data/vendor/assets/stylesheets/sd/sd/_flexisel.scss +53 -0
  353. data/vendor/assets/stylesheets/sd/sd/_footers.scss +216 -0
  354. data/vendor/assets/stylesheets/sd/sd/_icons.scss +127 -0
  355. data/vendor/assets/stylesheets/sd/sd/_inputs.scss +141 -0
  356. data/vendor/assets/stylesheets/sd/sd/_labels.scss +54 -0
  357. data/vendor/assets/stylesheets/sd/sd/_media.scss +80 -0
  358. data/vendor/assets/stylesheets/sd/sd/_misc.scss +115 -0
  359. data/vendor/assets/stylesheets/sd/sd/_mixins.scss +20 -0
  360. data/vendor/assets/stylesheets/sd/sd/_modal.scss +79 -0
  361. data/vendor/assets/stylesheets/sd/sd/_morphing-buttons.scss +161 -0
  362. data/vendor/assets/stylesheets/sd/sd/_navbars.scss +293 -0
  363. data/vendor/assets/stylesheets/sd/sd/_progress-bars.scss +9 -0
  364. data/vendor/assets/stylesheets/sd/sd/_responsive.scss +302 -0
  365. data/vendor/assets/stylesheets/sd/sd/_sections.scss +12 -0
  366. data/vendor/assets/stylesheets/sd/sd/_sidebar-menu.scss +232 -0
  367. data/vendor/assets/stylesheets/sd/sd/_sliders.scss +218 -0
  368. data/vendor/assets/stylesheets/sd/sd/_social-buttons.scss +76 -0
  369. data/vendor/assets/stylesheets/sd/sd/_tables.scss +110 -0
  370. data/vendor/assets/stylesheets/sd/sd/_tabs-navs-pagination.scss +217 -0
  371. data/vendor/assets/stylesheets/sd/sd/_tags.scss +220 -0
  372. data/vendor/assets/stylesheets/sd/sd/_tooltips-and-popovers.scss +156 -0
  373. data/vendor/assets/stylesheets/sd/sd/_typography.scss +73 -0
  374. data/vendor/assets/stylesheets/sd/sd/_variables.scss +249 -0
  375. data/vendor/assets/stylesheets/sd/sd/mixins/_buttons.scss +76 -0
  376. data/vendor/assets/stylesheets/sd/sd/mixins/_cards.scss +8 -0
  377. data/vendor/assets/stylesheets/sd/sd/mixins/_icons.scss +13 -0
  378. data/vendor/assets/stylesheets/sd/sd/mixins/_inputs.scss +17 -0
  379. data/vendor/assets/stylesheets/sd/sd/mixins/_labels.scss +21 -0
  380. data/vendor/assets/stylesheets/sd/sd/mixins/_morphing-buttons.scss +34 -0
  381. data/vendor/assets/stylesheets/sd/sd/mixins/_navbars.scss +11 -0
  382. data/vendor/assets/stylesheets/sd/sd/mixins/_social-buttons.scss +43 -0
  383. data/vendor/assets/stylesheets/sd/sd/mixins/_tabs.scss +4 -0
  384. data/vendor/assets/stylesheets/sd/sd/mixins/_transparency.scss +20 -0
  385. data/vendor/assets/stylesheets/sd/sd/mixins/_vendor-prefixes.scss +177 -0
  386. metadata +484 -0
@@ -0,0 +1,2576 @@
1
+ /*! version : 4.17.37
2
+ =========================================================
3
+ bootstrap-datetimejs
4
+ https://github.com/Eonasdan/bootstrap-datetimepicker
5
+ Copyright (c) 2015 Jonathan Peterson
6
+ =========================================================
7
+ */
8
+ /*
9
+ The MIT License (MIT)
10
+
11
+ Copyright (c) 2015 Jonathan Peterson
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in
21
+ all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
+ THE SOFTWARE.
30
+ */
31
+ /*global define:false */
32
+ /*global exports:false */
33
+ /*global require:false */
34
+ /*global jQuery:false */
35
+ /*global moment:false */
36
+ (function (factory) {
37
+ 'use strict';
38
+ if (typeof define === 'function' && define.amd) {
39
+ // AMD is used - Register as an anonymous module.
40
+ define(['jquery', 'moment'], factory);
41
+ } else if (typeof exports === 'object') {
42
+ factory(require('jquery'), require('moment'));
43
+ } else {
44
+ // Neither AMD nor CommonJS used. Use global variables.
45
+ if (typeof jQuery === 'undefined') {
46
+ throw 'bootstrap-datetimepicker requires jQuery to be loaded first';
47
+ }
48
+ if (typeof moment === 'undefined') {
49
+ throw 'bootstrap-datetimepicker requires Moment.js to be loaded first';
50
+ }
51
+ factory(jQuery, moment);
52
+ }
53
+ }(function ($, moment) {
54
+ 'use strict';
55
+ if (!moment) {
56
+ throw new Error('bootstrap-datetimepicker requires Moment.js to be loaded first');
57
+ }
58
+
59
+ var dateTimePicker = function (element, options) {
60
+ var picker = {},
61
+ date,
62
+ viewDate,
63
+ unset = true,
64
+ input,
65
+ component = false,
66
+ widget = false,
67
+ use24Hours,
68
+ minViewModeNumber = 0,
69
+ actualFormat,
70
+ parseFormats,
71
+ currentViewMode,
72
+ datePickerModes = [
73
+ {
74
+ clsName: 'days',
75
+ navFnc: 'M',
76
+ navStep: 1
77
+ },
78
+ {
79
+ clsName: 'months',
80
+ navFnc: 'y',
81
+ navStep: 1
82
+ },
83
+ {
84
+ clsName: 'years',
85
+ navFnc: 'y',
86
+ navStep: 10
87
+ },
88
+ {
89
+ clsName: 'decades',
90
+ navFnc: 'y',
91
+ navStep: 100
92
+ }
93
+ ],
94
+ viewModes = ['days', 'months', 'years', 'decades'],
95
+ verticalModes = ['top', 'bottom', 'auto'],
96
+ horizontalModes = ['left', 'right', 'auto'],
97
+ toolbarPlacements = ['default', 'top', 'bottom'],
98
+ keyMap = {
99
+ 'up': 38,
100
+ 38: 'up',
101
+ 'down': 40,
102
+ 40: 'down',
103
+ 'left': 37,
104
+ 37: 'left',
105
+ 'right': 39,
106
+ 39: 'right',
107
+ 'tab': 9,
108
+ 9: 'tab',
109
+ 'escape': 27,
110
+ 27: 'escape',
111
+ 'enter': 13,
112
+ 13: 'enter',
113
+ 'pageUp': 33,
114
+ 33: 'pageUp',
115
+ 'pageDown': 34,
116
+ 34: 'pageDown',
117
+ 'shift': 16,
118
+ 16: 'shift',
119
+ 'control': 17,
120
+ 17: 'control',
121
+ 'space': 32,
122
+ 32: 'space',
123
+ 't': 84,
124
+ 84: 't',
125
+ 'delete': 46,
126
+ 46: 'delete'
127
+ },
128
+ keyState = {},
129
+
130
+ /********************************************************************************
131
+ *
132
+ * Private functions
133
+ *
134
+ ********************************************************************************/
135
+ getMoment = function (d) {
136
+ var tzEnabled = false,
137
+ returnMoment,
138
+ currentZoneOffset,
139
+ incomingZoneOffset,
140
+ timeZoneIndicator,
141
+ dateWithTimeZoneInfo;
142
+
143
+ if (moment.tz !== undefined && options.timeZone !== undefined && options.timeZone !== null && options.timeZone !== '') {
144
+ tzEnabled = true;
145
+ }
146
+ if (d === undefined || d === null) {
147
+ if (tzEnabled) {
148
+ returnMoment = moment().tz(options.timeZone).startOf('d');
149
+ } else {
150
+ returnMoment = moment().startOf('d');
151
+ }
152
+ } else {
153
+ if (tzEnabled) {
154
+ currentZoneOffset = moment().tz(options.timeZone).utcOffset();
155
+ incomingZoneOffset = moment(d, parseFormats, options.useStrict).utcOffset();
156
+ if (incomingZoneOffset !== currentZoneOffset) {
157
+ timeZoneIndicator = moment().tz(options.timeZone).format('Z');
158
+ dateWithTimeZoneInfo = moment(d, parseFormats, options.useStrict).format('YYYY-MM-DD[T]HH:mm:ss') + timeZoneIndicator;
159
+ returnMoment = moment(dateWithTimeZoneInfo, parseFormats, options.useStrict).tz(options.timeZone);
160
+ } else {
161
+ returnMoment = moment(d, parseFormats, options.useStrict).tz(options.timeZone);
162
+ }
163
+ } else {
164
+ returnMoment = moment(d, parseFormats, options.useStrict);
165
+ }
166
+ }
167
+ return returnMoment;
168
+ },
169
+ isEnabled = function (granularity) {
170
+ if (typeof granularity !== 'string' || granularity.length > 1) {
171
+ throw new TypeError('isEnabled expects a single character string parameter');
172
+ }
173
+ switch (granularity) {
174
+ case 'y':
175
+ return actualFormat.indexOf('Y') !== -1;
176
+ case 'M':
177
+ return actualFormat.indexOf('M') !== -1;
178
+ case 'd':
179
+ return actualFormat.toLowerCase().indexOf('d') !== -1;
180
+ case 'h':
181
+ case 'H':
182
+ return actualFormat.toLowerCase().indexOf('h') !== -1;
183
+ case 'm':
184
+ return actualFormat.indexOf('m') !== -1;
185
+ case 's':
186
+ return actualFormat.indexOf('s') !== -1;
187
+ default:
188
+ return false;
189
+ }
190
+ },
191
+ hasTime = function () {
192
+ return (isEnabled('h') || isEnabled('m') || isEnabled('s'));
193
+ },
194
+
195
+ hasDate = function () {
196
+ return (isEnabled('y') || isEnabled('M') || isEnabled('d'));
197
+ },
198
+
199
+ getDatePickerTemplate = function () {
200
+ var headTemplate = $('<thead>')
201
+ .append($('<tr>')
202
+ .append($('<th>').addClass('prev').attr('data-action', 'previous')
203
+ .append($('<span>').addClass(options.icons.previous))
204
+ )
205
+ .append($('<th>').addClass('picker-switch').attr('data-action', 'pickerSwitch').attr('colspan', (options.calendarWeeks ? '6' : '5')))
206
+ .append($('<th>').addClass('next').attr('data-action', 'next')
207
+ .append($('<span>').addClass(options.icons.next))
208
+ )
209
+ ),
210
+ contTemplate = $('<tbody>')
211
+ .append($('<tr>')
212
+ .append($('<td>').attr('colspan', (options.calendarWeeks ? '8' : '7')))
213
+ );
214
+
215
+ return [
216
+ $('<div>').addClass('datepicker-days')
217
+ .append($('<table>').addClass('table-condensed')
218
+ .append(headTemplate)
219
+ .append($('<tbody>'))
220
+ ),
221
+ $('<div>').addClass('datepicker-months')
222
+ .append($('<table>').addClass('table-condensed')
223
+ .append(headTemplate.clone())
224
+ .append(contTemplate.clone())
225
+ ),
226
+ $('<div>').addClass('datepicker-years')
227
+ .append($('<table>').addClass('table-condensed')
228
+ .append(headTemplate.clone())
229
+ .append(contTemplate.clone())
230
+ ),
231
+ $('<div>').addClass('datepicker-decades')
232
+ .append($('<table>').addClass('table-condensed')
233
+ .append(headTemplate.clone())
234
+ .append(contTemplate.clone())
235
+ )
236
+ ];
237
+ },
238
+
239
+ getTimePickerMainTemplate = function () {
240
+ var topRow = $('<tr>'),
241
+ middleRow = $('<tr>'),
242
+ bottomRow = $('<tr>');
243
+
244
+ if (isEnabled('h')) {
245
+ topRow.append($('<td>')
246
+ .append($('<a>').attr({href: '#', tabindex: '-1', 'title': options.tooltips.incrementHour}).addClass('btn').attr('data-action', 'incrementHours')
247
+ .append($('<span>').addClass(options.icons.up))));
248
+ middleRow.append($('<td>')
249
+ .append($('<span>').addClass('timepicker-hour').attr({'data-time-component':'hours', 'title': options.tooltips.pickHour}).attr('data-action', 'showHours')));
250
+ bottomRow.append($('<td>')
251
+ .append($('<a>').attr({href: '#', tabindex: '-1', 'title': options.tooltips.decrementHour}).addClass('btn').attr('data-action', 'decrementHours')
252
+ .append($('<span>').addClass(options.icons.down))));
253
+ }
254
+ if (isEnabled('m')) {
255
+ if (isEnabled('h')) {
256
+ topRow.append($('<td>').addClass('separator'));
257
+ middleRow.append($('<td>').addClass('separator').html(':'));
258
+ bottomRow.append($('<td>').addClass('separator'));
259
+ }
260
+ topRow.append($('<td>')
261
+ .append($('<a>').attr({href: '#', tabindex: '-1', 'title': options.tooltips.incrementMinute}).addClass('btn').attr('data-action', 'incrementMinutes')
262
+ .append($('<span>').addClass(options.icons.up))));
263
+ middleRow.append($('<td>')
264
+ .append($('<span>').addClass('timepicker-minute').attr({'data-time-component': 'minutes', 'title': options.tooltips.pickMinute}).attr('data-action', 'showMinutes')));
265
+ bottomRow.append($('<td>')
266
+ .append($('<a>').attr({href: '#', tabindex: '-1', 'title': options.tooltips.decrementMinute}).addClass('btn').attr('data-action', 'decrementMinutes')
267
+ .append($('<span>').addClass(options.icons.down))));
268
+ }
269
+ if (isEnabled('s')) {
270
+ if (isEnabled('m')) {
271
+ topRow.append($('<td>').addClass('separator'));
272
+ middleRow.append($('<td>').addClass('separator').html(':'));
273
+ bottomRow.append($('<td>').addClass('separator'));
274
+ }
275
+ topRow.append($('<td>')
276
+ .append($('<a>').attr({href: '#', tabindex: '-1', 'title': options.tooltips.incrementSecond}).addClass('btn').attr('data-action', 'incrementSeconds')
277
+ .append($('<span>').addClass(options.icons.up))));
278
+ middleRow.append($('<td>')
279
+ .append($('<span>').addClass('timepicker-second').attr({'data-time-component': 'seconds', 'title': options.tooltips.pickSecond}).attr('data-action', 'showSeconds')));
280
+ bottomRow.append($('<td>')
281
+ .append($('<a>').attr({href: '#', tabindex: '-1', 'title': options.tooltips.decrementSecond}).addClass('btn').attr('data-action', 'decrementSeconds')
282
+ .append($('<span>').addClass(options.icons.down))));
283
+ }
284
+
285
+ if (!use24Hours) {
286
+ topRow.append($('<td>').addClass('separator'));
287
+ middleRow.append($('<td>')
288
+ .append($('<button>').addClass('btn btn-info btn-round').attr({'data-action': 'togglePeriod', tabindex: '-1', 'title': options.tooltips.togglePeriod})));
289
+ bottomRow.append($('<td>').addClass('separator'));
290
+ }
291
+
292
+ return $('<div>').addClass('timepicker-picker')
293
+ .append($('<table>').addClass('table-condensed')
294
+ .append([topRow, middleRow, bottomRow]));
295
+ },
296
+
297
+ getTimePickerTemplate = function () {
298
+ var hoursView = $('<div>').addClass('timepicker-hours')
299
+ .append($('<table>').addClass('table-condensed')),
300
+ minutesView = $('<div>').addClass('timepicker-minutes')
301
+ .append($('<table>').addClass('table-condensed')),
302
+ secondsView = $('<div>').addClass('timepicker-seconds')
303
+ .append($('<table>').addClass('table-condensed')),
304
+ ret = [getTimePickerMainTemplate()];
305
+
306
+ if (isEnabled('h')) {
307
+ ret.push(hoursView);
308
+ }
309
+ if (isEnabled('m')) {
310
+ ret.push(minutesView);
311
+ }
312
+ if (isEnabled('s')) {
313
+ ret.push(secondsView);
314
+ }
315
+
316
+ return ret;
317
+ },
318
+
319
+ getToolbar = function () {
320
+ var row = [];
321
+ if (options.showTodayButton) {
322
+ row.push($('<td>').append($('<a>').attr({'data-action':'today', 'title': options.tooltips.today}).append($('<span>').addClass(options.icons.today))));
323
+ }
324
+ if (!options.sideBySide && hasDate() && hasTime()) {
325
+ row.push($('<td>').append($('<a>').attr({'data-action':'togglePicker', 'title': options.tooltips.selectTime}).append($('<span>').addClass(options.icons.time))));
326
+ }
327
+ if (options.showClear) {
328
+ row.push($('<td>').append($('<a>').attr({'data-action':'clear', 'title': options.tooltips.clear}).append($('<span>').addClass(options.icons.clear))));
329
+ }
330
+ if (options.showClose) {
331
+ row.push($('<td>').append($('<a>').attr({'data-action':'close', 'title': options.tooltips.close}).append($('<span>').addClass(options.icons.close))));
332
+ }
333
+ return $('<table>').addClass('table-condensed').append($('<tbody>').append($('<tr>').append(row)));
334
+ },
335
+
336
+ getTemplate = function () {
337
+ var template = $('<div>').addClass('bootstrap-datetimepicker-widget dropdown-menu'),
338
+ dateView = $('<div>').addClass('datepicker').append(getDatePickerTemplate()),
339
+ timeView = $('<div>').addClass('timepicker').append(getTimePickerTemplate()),
340
+ content = $('<ul>').addClass('list-unstyled'),
341
+ toolbar = $('<li>').addClass('picker-switch' + (options.collapse ? ' accordion-toggle' : '')).append(getToolbar());
342
+
343
+ if (options.inline) {
344
+ template.removeClass('dropdown-menu');
345
+ }
346
+
347
+ if (use24Hours) {
348
+ template.addClass('usetwentyfour');
349
+ }
350
+ if (isEnabled('s') && !use24Hours) {
351
+ template.addClass('wider');
352
+ }
353
+
354
+ if (options.sideBySide && hasDate() && hasTime()) {
355
+ template.addClass('timepicker-sbs');
356
+ if (options.toolbarPlacement === 'top') {
357
+ template.append(toolbar);
358
+ }
359
+ template.append(
360
+ $('<div>').addClass('row')
361
+ .append(dateView.addClass('col-md-6'))
362
+ .append(timeView.addClass('col-md-6'))
363
+ );
364
+ if (options.toolbarPlacement === 'bottom') {
365
+ template.append(toolbar);
366
+ }
367
+ return template;
368
+ }
369
+
370
+ if (options.toolbarPlacement === 'top') {
371
+ content.append(toolbar);
372
+ }
373
+ if (hasDate()) {
374
+ content.append($('<li>').addClass((options.collapse && hasTime() ? 'collapse in' : '')).append(dateView));
375
+ }
376
+ if (options.toolbarPlacement === 'default') {
377
+ content.append(toolbar);
378
+ }
379
+ if (hasTime()) {
380
+ content.append($('<li>').addClass((options.collapse && hasDate() ? 'collapse' : '')).append(timeView));
381
+ }
382
+ if (options.toolbarPlacement === 'bottom') {
383
+ content.append(toolbar);
384
+ }
385
+ return template.append(content);
386
+ },
387
+
388
+ dataToOptions = function () {
389
+ var eData,
390
+ dataOptions = {};
391
+
392
+ if (element.is('input') || options.inline) {
393
+ eData = element.data();
394
+ } else {
395
+ eData = element.find('input').data();
396
+ }
397
+
398
+ if (eData.dateOptions && eData.dateOptions instanceof Object) {
399
+ dataOptions = $.extend(true, dataOptions, eData.dateOptions);
400
+ }
401
+
402
+ $.each(options, function (key) {
403
+ var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1);
404
+ if (eData[attributeName] !== undefined) {
405
+ dataOptions[key] = eData[attributeName];
406
+ }
407
+ });
408
+ return dataOptions;
409
+ },
410
+
411
+ place = function () {
412
+ var position = (component || element).position(),
413
+ offset = (component || element).offset(),
414
+ vertical = options.widgetPositioning.vertical,
415
+ horizontal = options.widgetPositioning.horizontal,
416
+ parent;
417
+
418
+ if (options.widgetParent) {
419
+ parent = options.widgetParent.append(widget);
420
+ } else if (element.is('input')) {
421
+ parent = element.after(widget).parent();
422
+ } else if (options.inline) {
423
+ parent = element.append(widget);
424
+ return;
425
+ } else {
426
+ parent = element;
427
+ element.children().first().after(widget);
428
+ }
429
+
430
+ // Top and bottom logic
431
+ if (vertical === 'auto') {
432
+ if (offset.top + widget.height() * 1.5 >= $(window).height() + $(window).scrollTop() &&
433
+ widget.height() + element.outerHeight() < offset.top) {
434
+ vertical = 'top';
435
+ } else {
436
+ vertical = 'bottom';
437
+ }
438
+ }
439
+
440
+ // Left and right logic
441
+ if (horizontal === 'auto') {
442
+ if (parent.width() < offset.left + widget.outerWidth() / 2 &&
443
+ offset.left + widget.outerWidth() > $(window).width()) {
444
+ horizontal = 'right';
445
+ } else {
446
+ horizontal = 'left';
447
+ }
448
+ }
449
+
450
+ if (vertical === 'top') {
451
+ widget.addClass('top').removeClass('bottom');
452
+ } else {
453
+ widget.addClass('bottom').removeClass('top');
454
+ }
455
+
456
+ if (horizontal === 'right') {
457
+ widget.addClass('pull-right');
458
+ } else {
459
+ widget.removeClass('pull-right');
460
+ }
461
+
462
+ // find the first parent element that has a relative css positioning
463
+ if (parent.css('position') !== 'relative') {
464
+ parent = parent.parents().filter(function () {
465
+ return $(this).css('position') === 'relative';
466
+ }).first();
467
+ }
468
+
469
+ if (parent.length === 0) {
470
+ throw new Error('datetimepicker component should be placed within a relative positioned container');
471
+ }
472
+
473
+
474
+
475
+ widget.css({
476
+ top: vertical === 'top' ? 'auto' : position.top + element.outerHeight(),
477
+ bottom: vertical === 'top' ? position.top + element.outerHeight() : 'auto',
478
+ left: horizontal === 'left' ? (parent === element ? 0 : position.left) : 'auto',
479
+ right: horizontal === 'left' ? 'auto' : parent.outerWidth() - element.outerWidth() - (parent === element ? 0 : position.left)
480
+ });
481
+
482
+
483
+ setTimeout(function(){
484
+ widget.addClass('open');
485
+ }, 180);
486
+
487
+ },
488
+
489
+ notifyEvent = function (e) {
490
+ if (e.type === 'dp.change' && ((e.date && e.date.isSame(e.oldDate)) || (!e.date && !e.oldDate))) {
491
+ return;
492
+ }
493
+ element.trigger(e);
494
+ },
495
+
496
+ viewUpdate = function (e) {
497
+ if (e === 'y') {
498
+ e = 'YYYY';
499
+ }
500
+ notifyEvent({
501
+ type: 'dp.update',
502
+ change: e,
503
+ viewDate: viewDate.clone()
504
+ });
505
+ },
506
+
507
+ showMode = function (dir) {
508
+ if (!widget) {
509
+ return;
510
+ }
511
+ if (dir) {
512
+ currentViewMode = Math.max(minViewModeNumber, Math.min(3, currentViewMode + dir));
513
+ }
514
+ widget.find('.datepicker > div').hide().filter('.datepicker-' + datePickerModes[currentViewMode].clsName).show();
515
+ },
516
+
517
+ fillDow = function () {
518
+ var row = $('<tr>'),
519
+ currentDate = viewDate.clone().startOf('w').startOf('d');
520
+
521
+ if (options.calendarWeeks === true) {
522
+ row.append($('<th>').addClass('cw').text('#'));
523
+ }
524
+
525
+ while (currentDate.isBefore(viewDate.clone().endOf('w'))) {
526
+ row.append($('<th>').addClass('dow').text(currentDate.format('dd')));
527
+ currentDate.add(1, 'd');
528
+ }
529
+ widget.find('.datepicker-days thead').append(row);
530
+ },
531
+
532
+ isInDisabledDates = function (testDate) {
533
+ return options.disabledDates[testDate.format('YYYY-MM-DD')] === true;
534
+ },
535
+
536
+ isInEnabledDates = function (testDate) {
537
+ return options.enabledDates[testDate.format('YYYY-MM-DD')] === true;
538
+ },
539
+
540
+ isInDisabledHours = function (testDate) {
541
+ return options.disabledHours[testDate.format('H')] === true;
542
+ },
543
+
544
+ isInEnabledHours = function (testDate) {
545
+ return options.enabledHours[testDate.format('H')] === true;
546
+ },
547
+
548
+ isValid = function (targetMoment, granularity) {
549
+ if (!targetMoment.isValid()) {
550
+ return false;
551
+ }
552
+ if (options.disabledDates && granularity === 'd' && isInDisabledDates(targetMoment)) {
553
+ return false;
554
+ }
555
+ if (options.enabledDates && granularity === 'd' && !isInEnabledDates(targetMoment)) {
556
+ return false;
557
+ }
558
+ if (options.minDate && targetMoment.isBefore(options.minDate, granularity)) {
559
+ return false;
560
+ }
561
+ if (options.maxDate && targetMoment.isAfter(options.maxDate, granularity)) {
562
+ return false;
563
+ }
564
+ if (options.daysOfWeekDisabled && granularity === 'd' && options.daysOfWeekDisabled.indexOf(targetMoment.day()) !== -1) {
565
+ return false;
566
+ }
567
+ if (options.disabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && isInDisabledHours(targetMoment)) {
568
+ return false;
569
+ }
570
+ if (options.enabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && !isInEnabledHours(targetMoment)) {
571
+ return false;
572
+ }
573
+ if (options.disabledTimeIntervals && (granularity === 'h' || granularity === 'm' || granularity === 's')) {
574
+ var found = false;
575
+ $.each(options.disabledTimeIntervals, function () {
576
+ if (targetMoment.isBetween(this[0], this[1])) {
577
+ found = true;
578
+ return false;
579
+ }
580
+ });
581
+ if (found) {
582
+ return false;
583
+ }
584
+ }
585
+ return true;
586
+ },
587
+
588
+ fillMonths = function () {
589
+ var spans = [],
590
+ monthsShort = viewDate.clone().startOf('y').startOf('d');
591
+ while (monthsShort.isSame(viewDate, 'y')) {
592
+ spans.push($('<span>').attr('data-action', 'selectMonth').addClass('month').text(monthsShort.format('MMM')));
593
+ monthsShort.add(1, 'M');
594
+ }
595
+ widget.find('.datepicker-months td').empty().append(spans);
596
+ },
597
+
598
+ updateMonths = function () {
599
+ var monthsView = widget.find('.datepicker-months'),
600
+ monthsViewHeader = monthsView.find('th'),
601
+ months = monthsView.find('tbody').find('span');
602
+
603
+ monthsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevYear);
604
+ monthsViewHeader.eq(1).attr('title', options.tooltips.selectYear);
605
+ monthsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextYear);
606
+
607
+ monthsView.find('.disabled').removeClass('disabled');
608
+
609
+ if (!isValid(viewDate.clone().subtract(1, 'y'), 'y')) {
610
+ monthsViewHeader.eq(0).addClass('disabled');
611
+ }
612
+
613
+ monthsViewHeader.eq(1).text(viewDate.year());
614
+
615
+ if (!isValid(viewDate.clone().add(1, 'y'), 'y')) {
616
+ monthsViewHeader.eq(2).addClass('disabled');
617
+ }
618
+
619
+ months.removeClass('active');
620
+ if (date.isSame(viewDate, 'y') && !unset) {
621
+ months.eq(date.month()).addClass('active');
622
+ }
623
+
624
+ months.each(function (index) {
625
+ if (!isValid(viewDate.clone().month(index), 'M')) {
626
+ $(this).addClass('disabled');
627
+ }
628
+ });
629
+ },
630
+
631
+ updateYears = function () {
632
+ var yearsView = widget.find('.datepicker-years'),
633
+ yearsViewHeader = yearsView.find('th'),
634
+ startYear = viewDate.clone().subtract(5, 'y'),
635
+ endYear = viewDate.clone().add(6, 'y'),
636
+ html = '';
637
+
638
+ yearsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevDecade);
639
+ yearsViewHeader.eq(1).attr('title', options.tooltips.selectDecade);
640
+ yearsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextDecade);
641
+
642
+ yearsView.find('.disabled').removeClass('disabled');
643
+
644
+ if (options.minDate && options.minDate.isAfter(startYear, 'y')) {
645
+ yearsViewHeader.eq(0).addClass('disabled');
646
+ }
647
+
648
+ yearsViewHeader.eq(1).text(startYear.year() + '-' + endYear.year());
649
+
650
+ if (options.maxDate && options.maxDate.isBefore(endYear, 'y')) {
651
+ yearsViewHeader.eq(2).addClass('disabled');
652
+ }
653
+
654
+ while (!startYear.isAfter(endYear, 'y')) {
655
+ html += '<span data-action="selectYear" class="year' + (startYear.isSame(date, 'y') && !unset ? ' active' : '') + (!isValid(startYear, 'y') ? ' disabled' : '') + '">' + startYear.year() + '</span>';
656
+ startYear.add(1, 'y');
657
+ }
658
+
659
+ yearsView.find('td').html(html);
660
+ },
661
+
662
+ updateDecades = function () {
663
+ var decadesView = widget.find('.datepicker-decades'),
664
+ decadesViewHeader = decadesView.find('th'),
665
+ startDecade = moment({y: viewDate.year() - (viewDate.year() % 100) - 1}),
666
+ endDecade = startDecade.clone().add(100, 'y'),
667
+ startedAt = startDecade.clone(),
668
+ html = '';
669
+
670
+ decadesViewHeader.eq(0).find('span').attr('title', options.tooltips.prevCentury);
671
+ decadesViewHeader.eq(2).find('span').attr('title', options.tooltips.nextCentury);
672
+
673
+ decadesView.find('.disabled').removeClass('disabled');
674
+
675
+ if (startDecade.isSame(moment({y: 1900})) || (options.minDate && options.minDate.isAfter(startDecade, 'y'))) {
676
+ decadesViewHeader.eq(0).addClass('disabled');
677
+ }
678
+
679
+ decadesViewHeader.eq(1).text(startDecade.year() + '-' + endDecade.year());
680
+
681
+ if (startDecade.isSame(moment({y: 2000})) || (options.maxDate && options.maxDate.isBefore(endDecade, 'y'))) {
682
+ decadesViewHeader.eq(2).addClass('disabled');
683
+ }
684
+
685
+ while (!startDecade.isAfter(endDecade, 'y')) {
686
+ html += '<span data-action="selectDecade" class="decade' + (startDecade.isSame(date, 'y') ? ' active' : '') +
687
+ (!isValid(startDecade, 'y') ? ' disabled' : '') + '" data-selection="' + (startDecade.year() + 6) + '">' + (startDecade.year() + 1) + ' - ' + (startDecade.year() + 12) + '</span>';
688
+ startDecade.add(12, 'y');
689
+ }
690
+ html += '<span></span><span></span><span></span>'; //push the dangling block over, at least this way it's even
691
+
692
+ decadesView.find('td').html(html);
693
+ decadesViewHeader.eq(1).text((startedAt.year() + 1) + '-' + (startDecade.year()));
694
+ },
695
+
696
+ fillDate = function () {
697
+ var daysView = widget.find('.datepicker-days'),
698
+ daysViewHeader = daysView.find('th'),
699
+ currentDate,
700
+ html = [],
701
+ row,
702
+ clsName,
703
+ i;
704
+
705
+ if (!hasDate()) {
706
+ return;
707
+ }
708
+
709
+ daysViewHeader.eq(0).find('span').attr('title', options.tooltips.prevMonth);
710
+ daysViewHeader.eq(1).attr('title', options.tooltips.selectMonth);
711
+ daysViewHeader.eq(2).find('span').attr('title', options.tooltips.nextMonth);
712
+
713
+ daysView.find('.disabled').removeClass('disabled');
714
+ daysViewHeader.eq(1).text(viewDate.format(options.dayViewHeaderFormat));
715
+
716
+ if (!isValid(viewDate.clone().subtract(1, 'M'), 'M')) {
717
+ daysViewHeader.eq(0).addClass('disabled');
718
+ }
719
+ if (!isValid(viewDate.clone().add(1, 'M'), 'M')) {
720
+ daysViewHeader.eq(2).addClass('disabled');
721
+ }
722
+
723
+ currentDate = viewDate.clone().startOf('M').startOf('w').startOf('d');
724
+
725
+ for (i = 0; i < 42; i++) { //always display 42 days (should show 6 weeks)
726
+ if (currentDate.weekday() === 0) {
727
+ row = $('<tr>');
728
+ if (options.calendarWeeks) {
729
+ row.append('<td class="cw">' + currentDate.week() + '</td>');
730
+ }
731
+ html.push(row);
732
+ }
733
+ clsName = '';
734
+ if (currentDate.isBefore(viewDate, 'M')) {
735
+ clsName += ' old';
736
+ }
737
+ if (currentDate.isAfter(viewDate, 'M')) {
738
+ clsName += ' new';
739
+ }
740
+ if (currentDate.isSame(date, 'd') && !unset) {
741
+ clsName += ' active';
742
+ }
743
+ if (!isValid(currentDate, 'd')) {
744
+ clsName += ' disabled';
745
+ }
746
+ if (currentDate.isSame(getMoment(), 'd')) {
747
+ clsName += ' today';
748
+ }
749
+ if (currentDate.day() === 0 || currentDate.day() === 6) {
750
+ clsName += ' weekend';
751
+ }
752
+
753
+
754
+ row.append('<td data-action="selectDay" data-day="' + currentDate.format('L') + '" class="day' + clsName + '"><div>' + currentDate.date() + '</div></td>');
755
+ currentDate.add(1, 'd');
756
+ }
757
+
758
+ daysView.find('tbody').empty().append(html);
759
+
760
+ updateMonths();
761
+
762
+ updateYears();
763
+
764
+ updateDecades();
765
+ },
766
+
767
+ fillHours = function () {
768
+ var table = widget.find('.timepicker-hours table'),
769
+ currentHour = viewDate.clone().startOf('d'),
770
+ html = [],
771
+ row = $('<tr>');
772
+
773
+ if (viewDate.hour() > 11 && !use24Hours) {
774
+ currentHour.hour(12);
775
+ }
776
+ while (currentHour.isSame(viewDate, 'd') && (use24Hours || (viewDate.hour() < 12 && currentHour.hour() < 12) || viewDate.hour() > 11)) {
777
+ if (currentHour.hour() % 4 === 0) {
778
+ row = $('<tr>');
779
+ html.push(row);
780
+ }
781
+
782
+ row.append('<td data-action="selectHour" class="hour' + (!isValid(currentHour, 'h') ? ' disabled' : '') + '"><div>' + currentHour.format(use24Hours ? 'HH' : 'hh') + '</div></td>');
783
+ currentHour.add(1, 'h');
784
+ }
785
+ table.empty().append(html);
786
+ },
787
+
788
+ fillMinutes = function () {
789
+ var table = widget.find('.timepicker-minutes table'),
790
+ currentMinute = viewDate.clone().startOf('h'),
791
+ html = [],
792
+ row = $('<tr>'),
793
+ step = options.stepping === 1 ? 5 : options.stepping;
794
+
795
+ while (viewDate.isSame(currentMinute, 'h')) {
796
+ if (currentMinute.minute() % (step * 4) === 0) {
797
+ row = $('<tr>');
798
+ html.push(row);
799
+ }
800
+
801
+
802
+ row.append('<td data-action="selectMinute" class="minute' + (!isValid(currentMinute, 'm') ? ' disabled' : '') + '"><div>' + currentMinute.format('mm') + '</div></td>');
803
+ currentMinute.add(step, 'm');
804
+ }
805
+ table.empty().append(html);
806
+ },
807
+
808
+ fillSeconds = function () {
809
+ var table = widget.find('.timepicker-seconds table'),
810
+ currentSecond = viewDate.clone().startOf('m'),
811
+ html = [],
812
+ row = $('<tr>');
813
+
814
+ while (viewDate.isSame(currentSecond, 'm')) {
815
+ if (currentSecond.second() % 20 === 0) {
816
+ row = $('<tr>');
817
+ html.push(row);
818
+ }
819
+
820
+ row.append('<td data-action="selectSecond" class="second' + (!isValid(currentSecond, 's') ? ' disabled' : '') + '"><div>' + currentSecond.format('ss') + '</div></td>');
821
+ currentSecond.add(5, 's');
822
+ }
823
+
824
+ table.empty().append(html);
825
+ },
826
+
827
+ fillTime = function () {
828
+ var toggle, newDate, timeComponents = widget.find('.timepicker span[data-time-component]');
829
+
830
+ if (!use24Hours) {
831
+ toggle = widget.find('.timepicker [data-action=togglePeriod]');
832
+ newDate = date.clone().add((date.hours() >= 12) ? -12 : 12, 'h');
833
+
834
+ toggle.text(date.format('A'));
835
+
836
+ if (isValid(newDate, 'h')) {
837
+ toggle.removeClass('disabled');
838
+ } else {
839
+ toggle.addClass('disabled');
840
+ }
841
+ }
842
+ timeComponents.filter('[data-time-component=hours]').text(date.format(use24Hours ? 'HH' : 'hh'));
843
+ timeComponents.filter('[data-time-component=minutes]').text(date.format('mm'));
844
+ timeComponents.filter('[data-time-component=seconds]').text(date.format('ss'));
845
+
846
+ fillHours();
847
+ fillMinutes();
848
+ fillSeconds();
849
+ },
850
+
851
+ update = function () {
852
+ if (!widget) {
853
+ return;
854
+ }
855
+ fillDate();
856
+ fillTime();
857
+ },
858
+
859
+ setValue = function (targetMoment) {
860
+ var oldDate = unset ? null : date;
861
+
862
+ // case of calling setValue(null or false)
863
+ if (!targetMoment) {
864
+ unset = true;
865
+ input.val('');
866
+ element.data('date', '');
867
+ notifyEvent({
868
+ type: 'dp.change',
869
+ date: false,
870
+ oldDate: oldDate
871
+ });
872
+ update();
873
+ return;
874
+ }
875
+
876
+ targetMoment = targetMoment.clone().locale(options.locale);
877
+
878
+ if (options.stepping !== 1) {
879
+ targetMoment.minutes((Math.round(targetMoment.minutes() / options.stepping) * options.stepping) % 60).seconds(0);
880
+ }
881
+
882
+ if (isValid(targetMoment)) {
883
+ date = targetMoment;
884
+ viewDate = date.clone();
885
+ input.val(date.format(actualFormat));
886
+ element.data('date', date.format(actualFormat));
887
+ unset = false;
888
+ update();
889
+ notifyEvent({
890
+ type: 'dp.change',
891
+ date: date.clone(),
892
+ oldDate: oldDate
893
+ });
894
+ } else {
895
+ if (!options.keepInvalid) {
896
+ input.val(unset ? '' : date.format(actualFormat));
897
+ }
898
+ notifyEvent({
899
+ type: 'dp.error',
900
+ date: targetMoment
901
+ });
902
+ }
903
+ },
904
+
905
+ hide = function () {
906
+ ///<summary>Hides the widget. Possibly will emit dp.hide</summary>
907
+ var transitioning = false;
908
+ if (!widget) {
909
+ return picker;
910
+ }
911
+ // Ignore event if in the middle of a picker transition
912
+ widget.find('.collapse').each(function () {
913
+ var collapseData = $(this).data('collapse');
914
+ if (collapseData && collapseData.transitioning) {
915
+ transitioning = true;
916
+ return false;
917
+ }
918
+ return true;
919
+ });
920
+ if (transitioning) {
921
+ return picker;
922
+ }
923
+ if (component && component.hasClass('btn')) {
924
+ component.toggleClass('active');
925
+ }
926
+
927
+
928
+ $(window).off('resize', place);
929
+ widget.off('click', '[data-action]');
930
+ widget.off('mousedown', false);
931
+
932
+ widget.removeClass('open');
933
+
934
+ setTimeout(function(){
935
+ widget.hide();
936
+
937
+ widget.remove();
938
+ widget = false;
939
+
940
+ notifyEvent({
941
+ type: 'dp.hide',
942
+ date: date.clone()
943
+ });
944
+
945
+ input.blur();
946
+
947
+ return picker;
948
+
949
+ }, 400);
950
+
951
+ },
952
+
953
+ clear = function () {
954
+ setValue(null);
955
+ },
956
+
957
+ /********************************************************************************
958
+ *
959
+ * Widget UI interaction functions
960
+ *
961
+ ********************************************************************************/
962
+ actions = {
963
+ next: function () {
964
+ var navFnc = datePickerModes[currentViewMode].navFnc;
965
+ viewDate.add(datePickerModes[currentViewMode].navStep, navFnc);
966
+ fillDate();
967
+ viewUpdate(navFnc);
968
+ },
969
+
970
+ previous: function () {
971
+ var navFnc = datePickerModes[currentViewMode].navFnc;
972
+ viewDate.subtract(datePickerModes[currentViewMode].navStep, navFnc);
973
+ fillDate();
974
+ viewUpdate(navFnc);
975
+ },
976
+
977
+ pickerSwitch: function () {
978
+ showMode(1);
979
+ },
980
+
981
+ selectMonth: function (e) {
982
+ var month = $(e.target).closest('tbody').find('span').index($(e.target));
983
+ viewDate.month(month);
984
+ if (currentViewMode === minViewModeNumber) {
985
+ setValue(date.clone().year(viewDate.year()).month(viewDate.month()));
986
+ if (!options.inline) {
987
+ hide();
988
+ }
989
+ } else {
990
+ showMode(-1);
991
+ fillDate();
992
+ }
993
+ viewUpdate('M');
994
+ },
995
+
996
+ selectYear: function (e) {
997
+ var year = parseInt($(e.target).text(), 10) || 0;
998
+ viewDate.year(year);
999
+ if (currentViewMode === minViewModeNumber) {
1000
+ setValue(date.clone().year(viewDate.year()));
1001
+ if (!options.inline) {
1002
+ hide();
1003
+ }
1004
+ } else {
1005
+ showMode(-1);
1006
+ fillDate();
1007
+ }
1008
+ viewUpdate('YYYY');
1009
+ },
1010
+
1011
+ selectDecade: function (e) {
1012
+ var year = parseInt($(e.target).data('selection'), 10) || 0;
1013
+ viewDate.year(year);
1014
+ if (currentViewMode === minViewModeNumber) {
1015
+ setValue(date.clone().year(viewDate.year()));
1016
+ if (!options.inline) {
1017
+ hide();
1018
+ }
1019
+ } else {
1020
+ showMode(-1);
1021
+ fillDate();
1022
+ }
1023
+ viewUpdate('YYYY');
1024
+ },
1025
+
1026
+ selectDay: function (e) {
1027
+ var day = viewDate.clone();
1028
+ if ($(e.target).is('.old')) {
1029
+ day.subtract(1, 'M');
1030
+ }
1031
+ if ($(e.target).is('.new')) {
1032
+ day.add(1, 'M');
1033
+ }
1034
+ setValue(day.date(parseInt($(e.target).text(), 10)));
1035
+ if (!hasTime() && !options.keepOpen && !options.inline) {
1036
+ hide();
1037
+ }
1038
+ },
1039
+
1040
+ incrementHours: function () {
1041
+ var newDate = date.clone().add(1, 'h');
1042
+ if (isValid(newDate, 'h')) {
1043
+ setValue(newDate);
1044
+ }
1045
+ },
1046
+
1047
+ incrementMinutes: function () {
1048
+ var newDate = date.clone().add(options.stepping, 'm');
1049
+ if (isValid(newDate, 'm')) {
1050
+ setValue(newDate);
1051
+ }
1052
+ },
1053
+
1054
+ incrementSeconds: function () {
1055
+ var newDate = date.clone().add(1, 's');
1056
+ if (isValid(newDate, 's')) {
1057
+ setValue(newDate);
1058
+ }
1059
+ },
1060
+
1061
+ decrementHours: function () {
1062
+ var newDate = date.clone().subtract(1, 'h');
1063
+ if (isValid(newDate, 'h')) {
1064
+ setValue(newDate);
1065
+ }
1066
+ },
1067
+
1068
+ decrementMinutes: function () {
1069
+ var newDate = date.clone().subtract(options.stepping, 'm');
1070
+ if (isValid(newDate, 'm')) {
1071
+ setValue(newDate);
1072
+ }
1073
+ },
1074
+
1075
+ decrementSeconds: function () {
1076
+ var newDate = date.clone().subtract(1, 's');
1077
+ if (isValid(newDate, 's')) {
1078
+ setValue(newDate);
1079
+ }
1080
+ },
1081
+
1082
+ togglePeriod: function () {
1083
+ setValue(date.clone().add((date.hours() >= 12) ? -12 : 12, 'h'));
1084
+ },
1085
+
1086
+ togglePicker: function (e) {
1087
+ var $this = $(e.target),
1088
+ $parent = $this.closest('ul'),
1089
+ expanded = $parent.find('.in'),
1090
+ closed = $parent.find('.collapse:not(.in)'),
1091
+ collapseData;
1092
+
1093
+ if (expanded && expanded.length) {
1094
+ collapseData = expanded.data('collapse');
1095
+ if (collapseData && collapseData.transitioning) {
1096
+ return;
1097
+ }
1098
+ if (expanded.collapse) { // if collapse plugin is available through bootstrap.js then use it
1099
+ expanded.collapse('hide');
1100
+ closed.collapse('show');
1101
+ } else { // otherwise just toggle in class on the two views
1102
+ expanded.removeClass('in');
1103
+ closed.addClass('in');
1104
+ }
1105
+ if ($this.is('span')) {
1106
+ $this.toggleClass(options.icons.time + ' ' + options.icons.date);
1107
+ } else {
1108
+ $this.find('span').toggleClass(options.icons.time + ' ' + options.icons.date);
1109
+ }
1110
+
1111
+ // NOTE: uncomment if toggled state will be restored in show()
1112
+ //if (component) {
1113
+ // component.find('span').toggleClass(options.icons.time + ' ' + options.icons.date);
1114
+ //}
1115
+ }
1116
+ },
1117
+
1118
+ showPicker: function () {
1119
+ widget.find('.timepicker > div:not(.timepicker-picker)').hide();
1120
+ widget.find('.timepicker .timepicker-picker').show();
1121
+ },
1122
+
1123
+ showHours: function () {
1124
+ widget.find('.timepicker .timepicker-picker').hide();
1125
+ widget.find('.timepicker .timepicker-hours').show();
1126
+ },
1127
+
1128
+ showMinutes: function () {
1129
+ widget.find('.timepicker .timepicker-picker').hide();
1130
+ widget.find('.timepicker .timepicker-minutes').show();
1131
+ },
1132
+
1133
+ showSeconds: function () {
1134
+ widget.find('.timepicker .timepicker-picker').hide();
1135
+ widget.find('.timepicker .timepicker-seconds').show();
1136
+ },
1137
+
1138
+ selectHour: function (e) {
1139
+ var hour = parseInt($(e.target).text(), 10);
1140
+
1141
+ if (!use24Hours) {
1142
+ if (date.hours() >= 12) {
1143
+ if (hour !== 12) {
1144
+ hour += 12;
1145
+ }
1146
+ } else {
1147
+ if (hour === 12) {
1148
+ hour = 0;
1149
+ }
1150
+ }
1151
+ }
1152
+ setValue(date.clone().hours(hour));
1153
+ actions.showPicker.call(picker);
1154
+ },
1155
+
1156
+ selectMinute: function (e) {
1157
+ setValue(date.clone().minutes(parseInt($(e.target).text(), 10)));
1158
+ actions.showPicker.call(picker);
1159
+ },
1160
+
1161
+ selectSecond: function (e) {
1162
+ setValue(date.clone().seconds(parseInt($(e.target).text(), 10)));
1163
+ actions.showPicker.call(picker);
1164
+ },
1165
+
1166
+ clear: clear,
1167
+
1168
+ today: function () {
1169
+ var todaysDate = getMoment();
1170
+ if (isValid(todaysDate, 'd')) {
1171
+ setValue(todaysDate);
1172
+ }
1173
+ },
1174
+
1175
+ close: hide
1176
+ },
1177
+
1178
+ doAction = function (e) {
1179
+ if ($(e.currentTarget).is('.disabled')) {
1180
+ return false;
1181
+ }
1182
+ actions[$(e.currentTarget).data('action')].apply(picker, arguments);
1183
+ return false;
1184
+ },
1185
+
1186
+ show = function () {
1187
+ ///<summary>Shows the widget. Possibly will emit dp.show and dp.change</summary>
1188
+ var currentMoment,
1189
+ useCurrentGranularity = {
1190
+ 'year': function (m) {
1191
+ return m.month(0).date(1).hours(0).seconds(0).minutes(0);
1192
+ },
1193
+ 'month': function (m) {
1194
+ return m.date(1).hours(0).seconds(0).minutes(0);
1195
+ },
1196
+ 'day': function (m) {
1197
+ return m.hours(0).seconds(0).minutes(0);
1198
+ },
1199
+ 'hour': function (m) {
1200
+ return m.seconds(0).minutes(0);
1201
+ },
1202
+ 'minute': function (m) {
1203
+ return m.seconds(0);
1204
+ }
1205
+ };
1206
+
1207
+ if (input.prop('disabled') || (!options.ignoreReadonly && input.prop('readonly')) || widget) {
1208
+ return picker;
1209
+ }
1210
+ if (input.val() !== undefined && input.val().trim().length !== 0) {
1211
+ setValue(parseInputDate(input.val().trim()));
1212
+ } else if (options.useCurrent && unset && ((input.is('input') && input.val().trim().length === 0) || options.inline)) {
1213
+ currentMoment = getMoment();
1214
+ if (typeof options.useCurrent === 'string') {
1215
+ currentMoment = useCurrentGranularity[options.useCurrent](currentMoment);
1216
+ }
1217
+ setValue(currentMoment);
1218
+ }
1219
+
1220
+ widget = getTemplate();
1221
+
1222
+ fillDow();
1223
+ fillMonths();
1224
+
1225
+ widget.find('.timepicker-hours').hide();
1226
+ widget.find('.timepicker-minutes').hide();
1227
+ widget.find('.timepicker-seconds').hide();
1228
+
1229
+ update();
1230
+ showMode();
1231
+
1232
+ $(window).on('resize', place);
1233
+ widget.on('click', '[data-action]', doAction); // this handles clicks on the widget
1234
+ widget.on('mousedown', false);
1235
+
1236
+ if (component && component.hasClass('btn')) {
1237
+ component.toggleClass('active');
1238
+ }
1239
+ widget.show();
1240
+
1241
+ place();
1242
+
1243
+
1244
+ if (options.focusOnShow && !input.is(':focus')) {
1245
+ input.focus();
1246
+ }
1247
+
1248
+ notifyEvent({
1249
+ type: 'dp.show'
1250
+ });
1251
+ return picker;
1252
+ },
1253
+
1254
+ toggle = function () {
1255
+ /// <summary>Shows or hides the widget</summary>
1256
+ return (widget ? hide() : show());
1257
+ },
1258
+
1259
+ parseInputDate = function (inputDate) {
1260
+ if (options.parseInputDate === undefined) {
1261
+ if (moment.isMoment(inputDate) || inputDate instanceof Date) {
1262
+ inputDate = moment(inputDate);
1263
+ } else {
1264
+ inputDate = getMoment(inputDate);
1265
+ }
1266
+ } else {
1267
+ inputDate = options.parseInputDate(inputDate);
1268
+ }
1269
+ inputDate.locale(options.locale);
1270
+ return inputDate;
1271
+ },
1272
+
1273
+ keydown = function (e) {
1274
+ var handler = null,
1275
+ index,
1276
+ index2,
1277
+ pressedKeys = [],
1278
+ pressedModifiers = {},
1279
+ currentKey = e.which,
1280
+ keyBindKeys,
1281
+ allModifiersPressed,
1282
+ pressed = 'p';
1283
+
1284
+ keyState[currentKey] = pressed;
1285
+
1286
+ for (index in keyState) {
1287
+ if (keyState.hasOwnProperty(index) && keyState[index] === pressed) {
1288
+ pressedKeys.push(index);
1289
+ if (parseInt(index, 10) !== currentKey) {
1290
+ pressedModifiers[index] = true;
1291
+ }
1292
+ }
1293
+ }
1294
+
1295
+ for (index in options.keyBinds) {
1296
+ if (options.keyBinds.hasOwnProperty(index) && typeof (options.keyBinds[index]) === 'function') {
1297
+ keyBindKeys = index.split(' ');
1298
+ if (keyBindKeys.length === pressedKeys.length && keyMap[currentKey] === keyBindKeys[keyBindKeys.length - 1]) {
1299
+ allModifiersPressed = true;
1300
+ for (index2 = keyBindKeys.length - 2; index2 >= 0; index2--) {
1301
+ if (!(keyMap[keyBindKeys[index2]] in pressedModifiers)) {
1302
+ allModifiersPressed = false;
1303
+ break;
1304
+ }
1305
+ }
1306
+ if (allModifiersPressed) {
1307
+ handler = options.keyBinds[index];
1308
+ break;
1309
+ }
1310
+ }
1311
+ }
1312
+ }
1313
+
1314
+ if (handler) {
1315
+ handler.call(picker, widget);
1316
+ e.stopPropagation();
1317
+ e.preventDefault();
1318
+ }
1319
+ },
1320
+
1321
+ keyup = function (e) {
1322
+ keyState[e.which] = 'r';
1323
+ e.stopPropagation();
1324
+ e.preventDefault();
1325
+ },
1326
+
1327
+ change = function (e) {
1328
+ var val = $(e.target).val().trim(),
1329
+ parsedDate = val ? parseInputDate(val) : null;
1330
+ setValue(parsedDate);
1331
+ e.stopImmediatePropagation();
1332
+ return false;
1333
+ },
1334
+
1335
+ attachDatePickerElementEvents = function () {
1336
+ input.on({
1337
+ 'change': change,
1338
+ 'blur': options.debug ? '' : hide,
1339
+ 'keydown': keydown,
1340
+ 'keyup': keyup,
1341
+ 'focus': options.allowInputToggle ? show : ''
1342
+ });
1343
+
1344
+ if (element.is('input')) {
1345
+ input.on({
1346
+ 'focus': show
1347
+ });
1348
+ } else if (component) {
1349
+ component.on('click', toggle);
1350
+ component.on('mousedown', false);
1351
+ }
1352
+ },
1353
+
1354
+ detachDatePickerElementEvents = function () {
1355
+ input.off({
1356
+ 'change': change,
1357
+ 'blur': blur,
1358
+ 'keydown': keydown,
1359
+ 'keyup': keyup,
1360
+ 'focus': options.allowInputToggle ? hide : ''
1361
+ });
1362
+
1363
+ if (element.is('input')) {
1364
+ input.off({
1365
+ 'focus': show
1366
+ });
1367
+ } else if (component) {
1368
+ component.off('click', toggle);
1369
+ component.off('mousedown', false);
1370
+ }
1371
+ },
1372
+
1373
+ indexGivenDates = function (givenDatesArray) {
1374
+ // Store given enabledDates and disabledDates as keys.
1375
+ // This way we can check their existence in O(1) time instead of looping through whole array.
1376
+ // (for example: options.enabledDates['2014-02-27'] === true)
1377
+ var givenDatesIndexed = {};
1378
+ $.each(givenDatesArray, function () {
1379
+ var dDate = parseInputDate(this);
1380
+ if (dDate.isValid()) {
1381
+ givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true;
1382
+ }
1383
+ });
1384
+ return (Object.keys(givenDatesIndexed).length) ? givenDatesIndexed : false;
1385
+ },
1386
+
1387
+ indexGivenHours = function (givenHoursArray) {
1388
+ // Store given enabledHours and disabledHours as keys.
1389
+ // This way we can check their existence in O(1) time instead of looping through whole array.
1390
+ // (for example: options.enabledHours['2014-02-27'] === true)
1391
+ var givenHoursIndexed = {};
1392
+ $.each(givenHoursArray, function () {
1393
+ givenHoursIndexed[this] = true;
1394
+ });
1395
+ return (Object.keys(givenHoursIndexed).length) ? givenHoursIndexed : false;
1396
+ },
1397
+
1398
+ initFormatting = function () {
1399
+ var format = options.format || 'L LT';
1400
+
1401
+ actualFormat = format.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) {
1402
+ var newinput = date.localeData().longDateFormat(formatInput) || formatInput;
1403
+ return newinput.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput2) { //temp fix for #740
1404
+ return date.localeData().longDateFormat(formatInput2) || formatInput2;
1405
+ });
1406
+ });
1407
+
1408
+
1409
+ parseFormats = options.extraFormats ? options.extraFormats.slice() : [];
1410
+ if (parseFormats.indexOf(format) < 0 && parseFormats.indexOf(actualFormat) < 0) {
1411
+ parseFormats.push(actualFormat);
1412
+ }
1413
+
1414
+ use24Hours = (actualFormat.toLowerCase().indexOf('a') < 1 && actualFormat.replace(/\[.*?\]/g, '').indexOf('h') < 1);
1415
+
1416
+ if (isEnabled('y')) {
1417
+ minViewModeNumber = 2;
1418
+ }
1419
+ if (isEnabled('M')) {
1420
+ minViewModeNumber = 1;
1421
+ }
1422
+ if (isEnabled('d')) {
1423
+ minViewModeNumber = 0;
1424
+ }
1425
+
1426
+ currentViewMode = Math.max(minViewModeNumber, currentViewMode);
1427
+
1428
+ if (!unset) {
1429
+ setValue(date);
1430
+ }
1431
+ };
1432
+
1433
+ /********************************************************************************
1434
+ *
1435
+ * Public API functions
1436
+ * =====================
1437
+ *
1438
+ * Important: Do not expose direct references to private objects or the options
1439
+ * object to the outer world. Always return a clone when returning values or make
1440
+ * a clone when setting a private variable.
1441
+ *
1442
+ ********************************************************************************/
1443
+ picker.destroy = function () {
1444
+ ///<summary>Destroys the widget and removes all attached event listeners</summary>
1445
+ hide();
1446
+ detachDatePickerElementEvents();
1447
+ element.removeData('DateTimePicker');
1448
+ element.removeData('date');
1449
+ };
1450
+
1451
+ picker.toggle = toggle;
1452
+
1453
+ picker.show = show;
1454
+
1455
+ picker.hide = hide;
1456
+
1457
+ picker.disable = function () {
1458
+ ///<summary>Disables the input element, the component is attached to, by adding a disabled="true" attribute to it.
1459
+ ///If the widget was visible before that call it is hidden. Possibly emits dp.hide</summary>
1460
+ hide();
1461
+ if (component && component.hasClass('btn')) {
1462
+ component.addClass('disabled');
1463
+ }
1464
+ input.prop('disabled', true);
1465
+ return picker;
1466
+ };
1467
+
1468
+ picker.enable = function () {
1469
+ ///<summary>Enables the input element, the component is attached to, by removing disabled attribute from it.</summary>
1470
+ if (component && component.hasClass('btn')) {
1471
+ component.removeClass('disabled');
1472
+ }
1473
+ input.prop('disabled', false);
1474
+ return picker;
1475
+ };
1476
+
1477
+ picker.ignoreReadonly = function (ignoreReadonly) {
1478
+ if (arguments.length === 0) {
1479
+ return options.ignoreReadonly;
1480
+ }
1481
+ if (typeof ignoreReadonly !== 'boolean') {
1482
+ throw new TypeError('ignoreReadonly () expects a boolean parameter');
1483
+ }
1484
+ options.ignoreReadonly = ignoreReadonly;
1485
+ return picker;
1486
+ };
1487
+
1488
+ picker.options = function (newOptions) {
1489
+ if (arguments.length === 0) {
1490
+ return $.extend(true, {}, options);
1491
+ }
1492
+
1493
+ if (!(newOptions instanceof Object)) {
1494
+ throw new TypeError('options() options parameter should be an object');
1495
+ }
1496
+ $.extend(true, options, newOptions);
1497
+ $.each(options, function (key, value) {
1498
+ if (picker[key] !== undefined) {
1499
+ picker[key](value);
1500
+ } else {
1501
+ throw new TypeError('option ' + key + ' is not recognized!');
1502
+ }
1503
+ });
1504
+ return picker;
1505
+ };
1506
+
1507
+ picker.date = function (newDate) {
1508
+ ///<signature helpKeyword="$.fn.datetimepicker.date">
1509
+ ///<summary>Returns the component's model current date, a moment object or null if not set.</summary>
1510
+ ///<returns type="Moment">date.clone()</returns>
1511
+ ///</signature>
1512
+ ///<signature>
1513
+ ///<summary>Sets the components model current moment to it. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.</summary>
1514
+ ///<param name="newDate" locid="$.fn.datetimepicker.date_p:newDate">Takes string, Date, moment, null parameter.</param>
1515
+ ///</signature>
1516
+ if (arguments.length === 0) {
1517
+ if (unset) {
1518
+ return null;
1519
+ }
1520
+ return date.clone();
1521
+ }
1522
+
1523
+ if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
1524
+ throw new TypeError('date() parameter must be one of [null, string, moment or Date]');
1525
+ }
1526
+
1527
+ setValue(newDate === null ? null : parseInputDate(newDate));
1528
+ return picker;
1529
+ };
1530
+
1531
+ picker.format = function (newFormat) {
1532
+ ///<summary>test su</summary>
1533
+ ///<param name="newFormat">info about para</param>
1534
+ ///<returns type="string|boolean">returns foo</returns>
1535
+ if (arguments.length === 0) {
1536
+ return options.format;
1537
+ }
1538
+
1539
+ if ((typeof newFormat !== 'string') && ((typeof newFormat !== 'boolean') || (newFormat !== false))) {
1540
+ throw new TypeError('format() expects a sting or boolean:false parameter ' + newFormat);
1541
+ }
1542
+
1543
+ options.format = newFormat;
1544
+ if (actualFormat) {
1545
+ initFormatting(); // reinit formatting
1546
+ }
1547
+ return picker;
1548
+ };
1549
+
1550
+ picker.timeZone = function (newZone) {
1551
+ if (arguments.length === 0) {
1552
+ return options.timeZone;
1553
+ }
1554
+
1555
+ options.timeZone = newZone;
1556
+
1557
+ return picker;
1558
+ };
1559
+
1560
+ picker.dayViewHeaderFormat = function (newFormat) {
1561
+ if (arguments.length === 0) {
1562
+ return options.dayViewHeaderFormat;
1563
+ }
1564
+
1565
+ if (typeof newFormat !== 'string') {
1566
+ throw new TypeError('dayViewHeaderFormat() expects a string parameter');
1567
+ }
1568
+
1569
+ options.dayViewHeaderFormat = newFormat;
1570
+ return picker;
1571
+ };
1572
+
1573
+ picker.extraFormats = function (formats) {
1574
+ if (arguments.length === 0) {
1575
+ return options.extraFormats;
1576
+ }
1577
+
1578
+ if (formats !== false && !(formats instanceof Array)) {
1579
+ throw new TypeError('extraFormats() expects an array or false parameter');
1580
+ }
1581
+
1582
+ options.extraFormats = formats;
1583
+ if (parseFormats) {
1584
+ initFormatting(); // reinit formatting
1585
+ }
1586
+ return picker;
1587
+ };
1588
+
1589
+ picker.disabledDates = function (dates) {
1590
+ ///<signature helpKeyword="$.fn.datetimepicker.disabledDates">
1591
+ ///<summary>Returns an array with the currently set disabled dates on the component.</summary>
1592
+ ///<returns type="array">options.disabledDates</returns>
1593
+ ///</signature>
1594
+ ///<signature>
1595
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
1596
+ ///options.enabledDates if such exist.</summary>
1597
+ ///<param name="dates" locid="$.fn.datetimepicker.disabledDates_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
1598
+ ///</signature>
1599
+ if (arguments.length === 0) {
1600
+ return (options.disabledDates ? $.extend({}, options.disabledDates) : options.disabledDates);
1601
+ }
1602
+
1603
+ if (!dates) {
1604
+ options.disabledDates = false;
1605
+ update();
1606
+ return picker;
1607
+ }
1608
+ if (!(dates instanceof Array)) {
1609
+ throw new TypeError('disabledDates() expects an array parameter');
1610
+ }
1611
+ options.disabledDates = indexGivenDates(dates);
1612
+ options.enabledDates = false;
1613
+ update();
1614
+ return picker;
1615
+ };
1616
+
1617
+ picker.enabledDates = function (dates) {
1618
+ ///<signature helpKeyword="$.fn.datetimepicker.enabledDates">
1619
+ ///<summary>Returns an array with the currently set enabled dates on the component.</summary>
1620
+ ///<returns type="array">options.enabledDates</returns>
1621
+ ///</signature>
1622
+ ///<signature>
1623
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledDates if such exist.</summary>
1624
+ ///<param name="dates" locid="$.fn.datetimepicker.enabledDates_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
1625
+ ///</signature>
1626
+ if (arguments.length === 0) {
1627
+ return (options.enabledDates ? $.extend({}, options.enabledDates) : options.enabledDates);
1628
+ }
1629
+
1630
+ if (!dates) {
1631
+ options.enabledDates = false;
1632
+ update();
1633
+ return picker;
1634
+ }
1635
+ if (!(dates instanceof Array)) {
1636
+ throw new TypeError('enabledDates() expects an array parameter');
1637
+ }
1638
+ options.enabledDates = indexGivenDates(dates);
1639
+ options.disabledDates = false;
1640
+ update();
1641
+ return picker;
1642
+ };
1643
+
1644
+ picker.daysOfWeekDisabled = function (daysOfWeekDisabled) {
1645
+ if (arguments.length === 0) {
1646
+ return options.daysOfWeekDisabled.splice(0);
1647
+ }
1648
+
1649
+ if ((typeof daysOfWeekDisabled === 'boolean') && !daysOfWeekDisabled) {
1650
+ options.daysOfWeekDisabled = false;
1651
+ update();
1652
+ return picker;
1653
+ }
1654
+
1655
+ if (!(daysOfWeekDisabled instanceof Array)) {
1656
+ throw new TypeError('daysOfWeekDisabled() expects an array parameter');
1657
+ }
1658
+ options.daysOfWeekDisabled = daysOfWeekDisabled.reduce(function (previousValue, currentValue) {
1659
+ currentValue = parseInt(currentValue, 10);
1660
+ if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) {
1661
+ return previousValue;
1662
+ }
1663
+ if (previousValue.indexOf(currentValue) === -1) {
1664
+ previousValue.push(currentValue);
1665
+ }
1666
+ return previousValue;
1667
+ }, []).sort();
1668
+ if (options.useCurrent && !options.keepInvalid) {
1669
+ var tries = 0;
1670
+ while (!isValid(date, 'd')) {
1671
+ date.add(1, 'd');
1672
+ if (tries === 7) {
1673
+ throw 'Tried 7 times to find a valid date';
1674
+ }
1675
+ tries++;
1676
+ }
1677
+ setValue(date);
1678
+ }
1679
+ update();
1680
+ return picker;
1681
+ };
1682
+
1683
+ picker.maxDate = function (maxDate) {
1684
+ if (arguments.length === 0) {
1685
+ return options.maxDate ? options.maxDate.clone() : options.maxDate;
1686
+ }
1687
+
1688
+ if ((typeof maxDate === 'boolean') && maxDate === false) {
1689
+ options.maxDate = false;
1690
+ update();
1691
+ return picker;
1692
+ }
1693
+
1694
+ if (typeof maxDate === 'string') {
1695
+ if (maxDate === 'now' || maxDate === 'moment') {
1696
+ maxDate = getMoment();
1697
+ }
1698
+ }
1699
+
1700
+ var parsedDate = parseInputDate(maxDate);
1701
+
1702
+ if (!parsedDate.isValid()) {
1703
+ throw new TypeError('maxDate() Could not parse date parameter: ' + maxDate);
1704
+ }
1705
+ if (options.minDate && parsedDate.isBefore(options.minDate)) {
1706
+ throw new TypeError('maxDate() date parameter is before options.minDate: ' + parsedDate.format(actualFormat));
1707
+ }
1708
+ options.maxDate = parsedDate;
1709
+ if (options.useCurrent && !options.keepInvalid && date.isAfter(maxDate)) {
1710
+ setValue(options.maxDate);
1711
+ }
1712
+ if (viewDate.isAfter(parsedDate)) {
1713
+ viewDate = parsedDate.clone().subtract(options.stepping, 'm');
1714
+ }
1715
+ update();
1716
+ return picker;
1717
+ };
1718
+
1719
+ picker.minDate = function (minDate) {
1720
+ if (arguments.length === 0) {
1721
+ return options.minDate ? options.minDate.clone() : options.minDate;
1722
+ }
1723
+
1724
+ if ((typeof minDate === 'boolean') && minDate === false) {
1725
+ options.minDate = false;
1726
+ update();
1727
+ return picker;
1728
+ }
1729
+
1730
+ if (typeof minDate === 'string') {
1731
+ if (minDate === 'now' || minDate === 'moment') {
1732
+ minDate = getMoment();
1733
+ }
1734
+ }
1735
+
1736
+ var parsedDate = parseInputDate(minDate);
1737
+
1738
+ if (!parsedDate.isValid()) {
1739
+ throw new TypeError('minDate() Could not parse date parameter: ' + minDate);
1740
+ }
1741
+ if (options.maxDate && parsedDate.isAfter(options.maxDate)) {
1742
+ throw new TypeError('minDate() date parameter is after options.maxDate: ' + parsedDate.format(actualFormat));
1743
+ }
1744
+ options.minDate = parsedDate;
1745
+ if (options.useCurrent && !options.keepInvalid && date.isBefore(minDate)) {
1746
+ setValue(options.minDate);
1747
+ }
1748
+ if (viewDate.isBefore(parsedDate)) {
1749
+ viewDate = parsedDate.clone().add(options.stepping, 'm');
1750
+ }
1751
+ update();
1752
+ return picker;
1753
+ };
1754
+
1755
+ picker.defaultDate = function (defaultDate) {
1756
+ ///<signature helpKeyword="$.fn.datetimepicker.defaultDate">
1757
+ ///<summary>Returns a moment with the options.defaultDate option configuration or false if not set</summary>
1758
+ ///<returns type="Moment">date.clone()</returns>
1759
+ ///</signature>
1760
+ ///<signature>
1761
+ ///<summary>Will set the picker's inital date. If a boolean:false value is passed the options.defaultDate parameter is cleared.</summary>
1762
+ ///<param name="defaultDate" locid="$.fn.datetimepicker.defaultDate_p:defaultDate">Takes a string, Date, moment, boolean:false</param>
1763
+ ///</signature>
1764
+ if (arguments.length === 0) {
1765
+ return options.defaultDate ? options.defaultDate.clone() : options.defaultDate;
1766
+ }
1767
+ if (!defaultDate) {
1768
+ options.defaultDate = false;
1769
+ return picker;
1770
+ }
1771
+
1772
+ if (typeof defaultDate === 'string') {
1773
+ if (defaultDate === 'now' || defaultDate === 'moment') {
1774
+ defaultDate = getMoment();
1775
+ }
1776
+ }
1777
+
1778
+ var parsedDate = parseInputDate(defaultDate);
1779
+ if (!parsedDate.isValid()) {
1780
+ throw new TypeError('defaultDate() Could not parse date parameter: ' + defaultDate);
1781
+ }
1782
+ if (!isValid(parsedDate)) {
1783
+ throw new TypeError('defaultDate() date passed is invalid according to component setup validations');
1784
+ }
1785
+
1786
+ options.defaultDate = parsedDate;
1787
+
1788
+ if ((options.defaultDate && options.inline) || input.val().trim() === '') {
1789
+ setValue(options.defaultDate);
1790
+ }
1791
+ return picker;
1792
+ };
1793
+
1794
+ picker.locale = function (locale) {
1795
+ if (arguments.length === 0) {
1796
+ return options.locale;
1797
+ }
1798
+
1799
+ if (!moment.localeData(locale)) {
1800
+ throw new TypeError('locale() locale ' + locale + ' is not loaded from moment locales!');
1801
+ }
1802
+
1803
+ options.locale = locale;
1804
+ date.locale(options.locale);
1805
+ viewDate.locale(options.locale);
1806
+
1807
+ if (actualFormat) {
1808
+ initFormatting(); // reinit formatting
1809
+ }
1810
+ if (widget) {
1811
+ hide();
1812
+ show();
1813
+ }
1814
+ return picker;
1815
+ };
1816
+
1817
+ picker.stepping = function (stepping) {
1818
+ if (arguments.length === 0) {
1819
+ return options.stepping;
1820
+ }
1821
+
1822
+ stepping = parseInt(stepping, 10);
1823
+ if (isNaN(stepping) || stepping < 1) {
1824
+ stepping = 1;
1825
+ }
1826
+ options.stepping = stepping;
1827
+ return picker;
1828
+ };
1829
+
1830
+ picker.useCurrent = function (useCurrent) {
1831
+ var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute'];
1832
+ if (arguments.length === 0) {
1833
+ return options.useCurrent;
1834
+ }
1835
+
1836
+ if ((typeof useCurrent !== 'boolean') && (typeof useCurrent !== 'string')) {
1837
+ throw new TypeError('useCurrent() expects a boolean or string parameter');
1838
+ }
1839
+ if (typeof useCurrent === 'string' && useCurrentOptions.indexOf(useCurrent.toLowerCase()) === -1) {
1840
+ throw new TypeError('useCurrent() expects a string parameter of ' + useCurrentOptions.join(', '));
1841
+ }
1842
+ options.useCurrent = useCurrent;
1843
+ return picker;
1844
+ };
1845
+
1846
+ picker.collapse = function (collapse) {
1847
+ if (arguments.length === 0) {
1848
+ return options.collapse;
1849
+ }
1850
+
1851
+ if (typeof collapse !== 'boolean') {
1852
+ throw new TypeError('collapse() expects a boolean parameter');
1853
+ }
1854
+ if (options.collapse === collapse) {
1855
+ return picker;
1856
+ }
1857
+ options.collapse = collapse;
1858
+ if (widget) {
1859
+ hide();
1860
+ show();
1861
+ }
1862
+ return picker;
1863
+ };
1864
+
1865
+ picker.icons = function (icons) {
1866
+ if (arguments.length === 0) {
1867
+ return $.extend({}, options.icons);
1868
+ }
1869
+
1870
+ if (!(icons instanceof Object)) {
1871
+ throw new TypeError('icons() expects parameter to be an Object');
1872
+ }
1873
+ $.extend(options.icons, icons);
1874
+ if (widget) {
1875
+ hide();
1876
+ show();
1877
+ }
1878
+ return picker;
1879
+ };
1880
+
1881
+ picker.tooltips = function (tooltips) {
1882
+ if (arguments.length === 0) {
1883
+ return $.extend({}, options.tooltips);
1884
+ }
1885
+
1886
+ if (!(tooltips instanceof Object)) {
1887
+ throw new TypeError('tooltips() expects parameter to be an Object');
1888
+ }
1889
+ $.extend(options.tooltips, tooltips);
1890
+ if (widget) {
1891
+ hide();
1892
+ show();
1893
+ }
1894
+ return picker;
1895
+ };
1896
+
1897
+ picker.useStrict = function (useStrict) {
1898
+ if (arguments.length === 0) {
1899
+ return options.useStrict;
1900
+ }
1901
+
1902
+ if (typeof useStrict !== 'boolean') {
1903
+ throw new TypeError('useStrict() expects a boolean parameter');
1904
+ }
1905
+ options.useStrict = useStrict;
1906
+ return picker;
1907
+ };
1908
+
1909
+ picker.sideBySide = function (sideBySide) {
1910
+ if (arguments.length === 0) {
1911
+ return options.sideBySide;
1912
+ }
1913
+
1914
+ if (typeof sideBySide !== 'boolean') {
1915
+ throw new TypeError('sideBySide() expects a boolean parameter');
1916
+ }
1917
+ options.sideBySide = sideBySide;
1918
+ if (widget) {
1919
+ hide();
1920
+ show();
1921
+ }
1922
+ return picker;
1923
+ };
1924
+
1925
+ picker.viewMode = function (viewMode) {
1926
+ if (arguments.length === 0) {
1927
+ return options.viewMode;
1928
+ }
1929
+
1930
+ if (typeof viewMode !== 'string') {
1931
+ throw new TypeError('viewMode() expects a string parameter');
1932
+ }
1933
+
1934
+ if (viewModes.indexOf(viewMode) === -1) {
1935
+ throw new TypeError('viewMode() parameter must be one of (' + viewModes.join(', ') + ') value');
1936
+ }
1937
+
1938
+ options.viewMode = viewMode;
1939
+ currentViewMode = Math.max(viewModes.indexOf(viewMode), minViewModeNumber);
1940
+
1941
+ showMode();
1942
+ return picker;
1943
+ };
1944
+
1945
+ picker.toolbarPlacement = function (toolbarPlacement) {
1946
+ if (arguments.length === 0) {
1947
+ return options.toolbarPlacement;
1948
+ }
1949
+
1950
+ if (typeof toolbarPlacement !== 'string') {
1951
+ throw new TypeError('toolbarPlacement() expects a string parameter');
1952
+ }
1953
+ if (toolbarPlacements.indexOf(toolbarPlacement) === -1) {
1954
+ throw new TypeError('toolbarPlacement() parameter must be one of (' + toolbarPlacements.join(', ') + ') value');
1955
+ }
1956
+ options.toolbarPlacement = toolbarPlacement;
1957
+
1958
+ if (widget) {
1959
+ hide();
1960
+ show();
1961
+ }
1962
+ return picker;
1963
+ };
1964
+
1965
+ picker.widgetPositioning = function (widgetPositioning) {
1966
+ if (arguments.length === 0) {
1967
+ return $.extend({}, options.widgetPositioning);
1968
+ }
1969
+
1970
+ if (({}).toString.call(widgetPositioning) !== '[object Object]') {
1971
+ throw new TypeError('widgetPositioning() expects an object variable');
1972
+ }
1973
+ if (widgetPositioning.horizontal) {
1974
+ if (typeof widgetPositioning.horizontal !== 'string') {
1975
+ throw new TypeError('widgetPositioning() horizontal variable must be a string');
1976
+ }
1977
+ widgetPositioning.horizontal = widgetPositioning.horizontal.toLowerCase();
1978
+ if (horizontalModes.indexOf(widgetPositioning.horizontal) === -1) {
1979
+ throw new TypeError('widgetPositioning() expects horizontal parameter to be one of (' + horizontalModes.join(', ') + ')');
1980
+ }
1981
+ options.widgetPositioning.horizontal = widgetPositioning.horizontal;
1982
+ }
1983
+ if (widgetPositioning.vertical) {
1984
+ if (typeof widgetPositioning.vertical !== 'string') {
1985
+ throw new TypeError('widgetPositioning() vertical variable must be a string');
1986
+ }
1987
+ widgetPositioning.vertical = widgetPositioning.vertical.toLowerCase();
1988
+ if (verticalModes.indexOf(widgetPositioning.vertical) === -1) {
1989
+ throw new TypeError('widgetPositioning() expects vertical parameter to be one of (' + verticalModes.join(', ') + ')');
1990
+ }
1991
+ options.widgetPositioning.vertical = widgetPositioning.vertical;
1992
+ }
1993
+ update();
1994
+ return picker;
1995
+ };
1996
+
1997
+ picker.calendarWeeks = function (calendarWeeks) {
1998
+ if (arguments.length === 0) {
1999
+ return options.calendarWeeks;
2000
+ }
2001
+
2002
+ if (typeof calendarWeeks !== 'boolean') {
2003
+ throw new TypeError('calendarWeeks() expects parameter to be a boolean value');
2004
+ }
2005
+
2006
+ options.calendarWeeks = calendarWeeks;
2007
+ update();
2008
+ return picker;
2009
+ };
2010
+
2011
+ picker.showTodayButton = function (showTodayButton) {
2012
+ if (arguments.length === 0) {
2013
+ return options.showTodayButton;
2014
+ }
2015
+
2016
+ if (typeof showTodayButton !== 'boolean') {
2017
+ throw new TypeError('showTodayButton() expects a boolean parameter');
2018
+ }
2019
+
2020
+ options.showTodayButton = showTodayButton;
2021
+ if (widget) {
2022
+ hide();
2023
+ show();
2024
+ }
2025
+ return picker;
2026
+ };
2027
+
2028
+ picker.showClear = function (showClear) {
2029
+ if (arguments.length === 0) {
2030
+ return options.showClear;
2031
+ }
2032
+
2033
+ if (typeof showClear !== 'boolean') {
2034
+ throw new TypeError('showClear() expects a boolean parameter');
2035
+ }
2036
+
2037
+ options.showClear = showClear;
2038
+ if (widget) {
2039
+ hide();
2040
+ show();
2041
+ }
2042
+ return picker;
2043
+ };
2044
+
2045
+ picker.widgetParent = function (widgetParent) {
2046
+ if (arguments.length === 0) {
2047
+ return options.widgetParent;
2048
+ }
2049
+
2050
+ if (typeof widgetParent === 'string') {
2051
+ widgetParent = $(widgetParent);
2052
+ }
2053
+
2054
+ if (widgetParent !== null && (typeof widgetParent !== 'string' && !(widgetParent instanceof $))) {
2055
+ throw new TypeError('widgetParent() expects a string or a jQuery object parameter');
2056
+ }
2057
+
2058
+ options.widgetParent = widgetParent;
2059
+ if (widget) {
2060
+ hide();
2061
+ show();
2062
+ }
2063
+ return picker;
2064
+ };
2065
+
2066
+ picker.keepOpen = function (keepOpen) {
2067
+ if (arguments.length === 0) {
2068
+ return options.keepOpen;
2069
+ }
2070
+
2071
+ if (typeof keepOpen !== 'boolean') {
2072
+ throw new TypeError('keepOpen() expects a boolean parameter');
2073
+ }
2074
+
2075
+ options.keepOpen = keepOpen;
2076
+ return picker;
2077
+ };
2078
+
2079
+ picker.focusOnShow = function (focusOnShow) {
2080
+ if (arguments.length === 0) {
2081
+ return options.focusOnShow;
2082
+ }
2083
+
2084
+ if (typeof focusOnShow !== 'boolean') {
2085
+ throw new TypeError('focusOnShow() expects a boolean parameter');
2086
+ }
2087
+
2088
+ options.focusOnShow = focusOnShow;
2089
+ return picker;
2090
+ };
2091
+
2092
+ picker.inline = function (inline) {
2093
+ if (arguments.length === 0) {
2094
+ return options.inline;
2095
+ }
2096
+
2097
+ if (typeof inline !== 'boolean') {
2098
+ throw new TypeError('inline() expects a boolean parameter');
2099
+ }
2100
+
2101
+ options.inline = inline;
2102
+ return picker;
2103
+ };
2104
+
2105
+ picker.clear = function () {
2106
+ clear();
2107
+ return picker;
2108
+ };
2109
+
2110
+ picker.keyBinds = function (keyBinds) {
2111
+ options.keyBinds = keyBinds;
2112
+ return picker;
2113
+ };
2114
+
2115
+ picker.getMoment = function (d) {
2116
+ return getMoment(d);
2117
+ };
2118
+
2119
+ picker.debug = function (debug) {
2120
+ if (typeof debug !== 'boolean') {
2121
+ throw new TypeError('debug() expects a boolean parameter');
2122
+ }
2123
+
2124
+ options.debug = debug;
2125
+ return picker;
2126
+ };
2127
+
2128
+ picker.allowInputToggle = function (allowInputToggle) {
2129
+ if (arguments.length === 0) {
2130
+ return options.allowInputToggle;
2131
+ }
2132
+
2133
+ if (typeof allowInputToggle !== 'boolean') {
2134
+ throw new TypeError('allowInputToggle() expects a boolean parameter');
2135
+ }
2136
+
2137
+ options.allowInputToggle = allowInputToggle;
2138
+ return picker;
2139
+ };
2140
+
2141
+ picker.showClose = function (showClose) {
2142
+ if (arguments.length === 0) {
2143
+ return options.showClose;
2144
+ }
2145
+
2146
+ if (typeof showClose !== 'boolean') {
2147
+ throw new TypeError('showClose() expects a boolean parameter');
2148
+ }
2149
+
2150
+ options.showClose = showClose;
2151
+ return picker;
2152
+ };
2153
+
2154
+ picker.keepInvalid = function (keepInvalid) {
2155
+ if (arguments.length === 0) {
2156
+ return options.keepInvalid;
2157
+ }
2158
+
2159
+ if (typeof keepInvalid !== 'boolean') {
2160
+ throw new TypeError('keepInvalid() expects a boolean parameter');
2161
+ }
2162
+ options.keepInvalid = keepInvalid;
2163
+ return picker;
2164
+ };
2165
+
2166
+ picker.datepickerInput = function (datepickerInput) {
2167
+ if (arguments.length === 0) {
2168
+ return options.datepickerInput;
2169
+ }
2170
+
2171
+ if (typeof datepickerInput !== 'string') {
2172
+ throw new TypeError('datepickerInput() expects a string parameter');
2173
+ }
2174
+
2175
+ options.datepickerInput = datepickerInput;
2176
+ return picker;
2177
+ };
2178
+
2179
+ picker.parseInputDate = function (parseInputDate) {
2180
+ if (arguments.length === 0) {
2181
+ return options.parseInputDate;
2182
+ }
2183
+
2184
+ if (typeof parseInputDate !== 'function') {
2185
+ throw new TypeError('parseInputDate() sholud be as function');
2186
+ }
2187
+
2188
+ options.parseInputDate = parseInputDate;
2189
+
2190
+ return picker;
2191
+ };
2192
+
2193
+ picker.disabledTimeIntervals = function (disabledTimeIntervals) {
2194
+ ///<signature helpKeyword="$.fn.datetimepicker.disabledTimeIntervals">
2195
+ ///<summary>Returns an array with the currently set disabled dates on the component.</summary>
2196
+ ///<returns type="array">options.disabledTimeIntervals</returns>
2197
+ ///</signature>
2198
+ ///<signature>
2199
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
2200
+ ///options.enabledDates if such exist.</summary>
2201
+ ///<param name="dates" locid="$.fn.datetimepicker.disabledTimeIntervals_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
2202
+ ///</signature>
2203
+ if (arguments.length === 0) {
2204
+ return (options.disabledTimeIntervals ? $.extend({}, options.disabledTimeIntervals) : options.disabledTimeIntervals);
2205
+ }
2206
+
2207
+ if (!disabledTimeIntervals) {
2208
+ options.disabledTimeIntervals = false;
2209
+ update();
2210
+ return picker;
2211
+ }
2212
+ if (!(disabledTimeIntervals instanceof Array)) {
2213
+ throw new TypeError('disabledTimeIntervals() expects an array parameter');
2214
+ }
2215
+ options.disabledTimeIntervals = disabledTimeIntervals;
2216
+ update();
2217
+ return picker;
2218
+ };
2219
+
2220
+ picker.disabledHours = function (hours) {
2221
+ ///<signature helpKeyword="$.fn.datetimepicker.disabledHours">
2222
+ ///<summary>Returns an array with the currently set disabled hours on the component.</summary>
2223
+ ///<returns type="array">options.disabledHours</returns>
2224
+ ///</signature>
2225
+ ///<signature>
2226
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
2227
+ ///options.enabledHours if such exist.</summary>
2228
+ ///<param name="hours" locid="$.fn.datetimepicker.disabledHours_p:hours">Takes an [ int ] of values and disallows the user to select only from those hours.</param>
2229
+ ///</signature>
2230
+ if (arguments.length === 0) {
2231
+ return (options.disabledHours ? $.extend({}, options.disabledHours) : options.disabledHours);
2232
+ }
2233
+
2234
+ if (!hours) {
2235
+ options.disabledHours = false;
2236
+ update();
2237
+ return picker;
2238
+ }
2239
+ if (!(hours instanceof Array)) {
2240
+ throw new TypeError('disabledHours() expects an array parameter');
2241
+ }
2242
+ options.disabledHours = indexGivenHours(hours);
2243
+ options.enabledHours = false;
2244
+ if (options.useCurrent && !options.keepInvalid) {
2245
+ var tries = 0;
2246
+ while (!isValid(date, 'h')) {
2247
+ date.add(1, 'h');
2248
+ if (tries === 24) {
2249
+ throw 'Tried 24 times to find a valid date';
2250
+ }
2251
+ tries++;
2252
+ }
2253
+ setValue(date);
2254
+ }
2255
+ update();
2256
+ return picker;
2257
+ };
2258
+
2259
+ picker.enabledHours = function (hours) {
2260
+ ///<signature helpKeyword="$.fn.datetimepicker.enabledHours">
2261
+ ///<summary>Returns an array with the currently set enabled hours on the component.</summary>
2262
+ ///<returns type="array">options.enabledHours</returns>
2263
+ ///</signature>
2264
+ ///<signature>
2265
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledHours if such exist.</summary>
2266
+ ///<param name="hours" locid="$.fn.datetimepicker.enabledHours_p:hours">Takes an [ int ] of values and allows the user to select only from those hours.</param>
2267
+ ///</signature>
2268
+ if (arguments.length === 0) {
2269
+ return (options.enabledHours ? $.extend({}, options.enabledHours) : options.enabledHours);
2270
+ }
2271
+
2272
+ if (!hours) {
2273
+ options.enabledHours = false;
2274
+ update();
2275
+ return picker;
2276
+ }
2277
+ if (!(hours instanceof Array)) {
2278
+ throw new TypeError('enabledHours() expects an array parameter');
2279
+ }
2280
+ options.enabledHours = indexGivenHours(hours);
2281
+ options.disabledHours = false;
2282
+ if (options.useCurrent && !options.keepInvalid) {
2283
+ var tries = 0;
2284
+ while (!isValid(date, 'h')) {
2285
+ date.add(1, 'h');
2286
+ if (tries === 24) {
2287
+ throw 'Tried 24 times to find a valid date';
2288
+ }
2289
+ tries++;
2290
+ }
2291
+ setValue(date);
2292
+ }
2293
+ update();
2294
+ return picker;
2295
+ };
2296
+
2297
+ picker.viewDate = function (newDate) {
2298
+ ///<signature helpKeyword="$.fn.datetimepicker.viewDate">
2299
+ ///<summary>Returns the component's model current viewDate, a moment object or null if not set.</summary>
2300
+ ///<returns type="Moment">viewDate.clone()</returns>
2301
+ ///</signature>
2302
+ ///<signature>
2303
+ ///<summary>Sets the components model current moment to it. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.</summary>
2304
+ ///<param name="newDate" locid="$.fn.datetimepicker.date_p:newDate">Takes string, viewDate, moment, null parameter.</param>
2305
+ ///</signature>
2306
+ if (arguments.length === 0) {
2307
+ return viewDate.clone();
2308
+ }
2309
+
2310
+ if (!newDate) {
2311
+ viewDate = date.clone();
2312
+ return picker;
2313
+ }
2314
+
2315
+ if (typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
2316
+ throw new TypeError('viewDate() parameter must be one of [string, moment or Date]');
2317
+ }
2318
+
2319
+ viewDate = parseInputDate(newDate);
2320
+ viewUpdate();
2321
+ return picker;
2322
+ };
2323
+
2324
+ // initializing element and component attributes
2325
+ if (element.is('input')) {
2326
+ input = element;
2327
+ } else {
2328
+ input = element.find(options.datepickerInput);
2329
+ if (input.size() === 0) {
2330
+ input = element.find('input');
2331
+ } else if (!input.is('input')) {
2332
+ throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element');
2333
+ }
2334
+ }
2335
+
2336
+ if (element.hasClass('input-group')) {
2337
+ // in case there is more then one 'input-group-addon' Issue #48
2338
+ if (element.find('.datepickerbutton').size() === 0) {
2339
+ component = element.find('.input-group-addon');
2340
+ } else {
2341
+ component = element.find('.datepickerbutton');
2342
+ }
2343
+ }
2344
+
2345
+ if (!options.inline && !input.is('input')) {
2346
+ throw new Error('Could not initialize DateTimePicker without an input element');
2347
+ }
2348
+
2349
+ // Set defaults for date here now instead of in var declaration
2350
+ date = getMoment();
2351
+ viewDate = date.clone();
2352
+
2353
+ $.extend(true, options, dataToOptions());
2354
+
2355
+ picker.options(options);
2356
+
2357
+ initFormatting();
2358
+
2359
+ attachDatePickerElementEvents();
2360
+
2361
+ if (input.prop('disabled')) {
2362
+ picker.disable();
2363
+ }
2364
+ if (input.is('input') && input.val().trim().length !== 0) {
2365
+ setValue(parseInputDate(input.val().trim()));
2366
+ }
2367
+ else if (options.defaultDate && input.attr('placeholder') === undefined) {
2368
+ setValue(options.defaultDate);
2369
+ }
2370
+ if (options.inline) {
2371
+ show();
2372
+ }
2373
+ return picker;
2374
+ };
2375
+
2376
+ /********************************************************************************
2377
+ *
2378
+ * jQuery plugin constructor and defaults object
2379
+ *
2380
+ ********************************************************************************/
2381
+
2382
+ $.fn.datetimepicker = function (options) {
2383
+ return this.each(function () {
2384
+ var $this = $(this);
2385
+ if (!$this.data('DateTimePicker')) {
2386
+ // create a private copy of the defaults object
2387
+ options = $.extend(true, {}, $.fn.datetimepicker.defaults, options);
2388
+ $this.data('DateTimePicker', dateTimePicker($this, options));
2389
+ }
2390
+ });
2391
+ };
2392
+
2393
+ $.fn.datetimepicker.defaults = {
2394
+ timeZone: 'Etc/UTC',
2395
+ format: false,
2396
+ dayViewHeaderFormat: 'MMMM YYYY',
2397
+ extraFormats: false,
2398
+ stepping: 1,
2399
+ minDate: false,
2400
+ maxDate: false,
2401
+ useCurrent: true,
2402
+ collapse: true,
2403
+ locale: moment.locale(),
2404
+ defaultDate: false,
2405
+ disabledDates: false,
2406
+ enabledDates: false,
2407
+ icons: {
2408
+ time: 'glyphicon glyphicon-time',
2409
+ date: 'glyphicon glyphicon-calendar',
2410
+ up: 'glyphicon glyphicon-chevron-up',
2411
+ down: 'glyphicon glyphicon-chevron-down',
2412
+ previous: 'glyphicon glyphicon-chevron-left',
2413
+ next: 'glyphicon glyphicon-chevron-right',
2414
+ today: 'glyphicon glyphicon-screenshot',
2415
+ clear: 'glyphicon glyphicon-trash',
2416
+ close: 'glyphicon glyphicon-remove'
2417
+ },
2418
+ tooltips: {
2419
+ today: 'Go to today',
2420
+ clear: 'Clear selection',
2421
+ close: 'Close the picker',
2422
+ selectMonth: 'Select Month',
2423
+ prevMonth: 'Previous Month',
2424
+ nextMonth: 'Next Month',
2425
+ selectYear: 'Select Year',
2426
+ prevYear: 'Previous Year',
2427
+ nextYear: 'Next Year',
2428
+ selectDecade: 'Select Decade',
2429
+ prevDecade: 'Previous Decade',
2430
+ nextDecade: 'Next Decade',
2431
+ prevCentury: 'Previous Century',
2432
+ nextCentury: 'Next Century',
2433
+ pickHour: 'Pick Hour',
2434
+ incrementHour: 'Increment Hour',
2435
+ decrementHour: 'Decrement Hour',
2436
+ pickMinute: 'Pick Minute',
2437
+ incrementMinute: 'Increment Minute',
2438
+ decrementMinute: 'Decrement Minute',
2439
+ pickSecond: 'Pick Second',
2440
+ incrementSecond: 'Increment Second',
2441
+ decrementSecond: 'Decrement Second',
2442
+ togglePeriod: 'Toggle Period',
2443
+ selectTime: 'Select Time'
2444
+ },
2445
+ useStrict: false,
2446
+ sideBySide: false,
2447
+ daysOfWeekDisabled: false,
2448
+ calendarWeeks: false,
2449
+ viewMode: 'days',
2450
+ toolbarPlacement: 'default',
2451
+ showTodayButton: false,
2452
+ showClear: false,
2453
+ showClose: false,
2454
+ widgetPositioning: {
2455
+ horizontal: 'auto',
2456
+ vertical: 'auto'
2457
+ },
2458
+ widgetParent: null,
2459
+ ignoreReadonly: false,
2460
+ keepOpen: false,
2461
+ focusOnShow: true,
2462
+ inline: false,
2463
+ keepInvalid: false,
2464
+ datepickerInput: '.datepickerinput',
2465
+ keyBinds: {
2466
+ up: function (widget) {
2467
+ if (!widget) {
2468
+ return;
2469
+ }
2470
+ var d = this.date() || this.getMoment();
2471
+ if (widget.find('.datepicker').is(':visible')) {
2472
+ this.date(d.clone().subtract(7, 'd'));
2473
+ } else {
2474
+ this.date(d.clone().add(this.stepping(), 'm'));
2475
+ }
2476
+ },
2477
+ down: function (widget) {
2478
+ if (!widget) {
2479
+ this.show();
2480
+ return;
2481
+ }
2482
+ var d = this.date() || this.getMoment();
2483
+ if (widget.find('.datepicker').is(':visible')) {
2484
+ this.date(d.clone().add(7, 'd'));
2485
+ } else {
2486
+ this.date(d.clone().subtract(this.stepping(), 'm'));
2487
+ }
2488
+ },
2489
+ 'control up': function (widget) {
2490
+ if (!widget) {
2491
+ return;
2492
+ }
2493
+ var d = this.date() || this.getMoment();
2494
+ if (widget.find('.datepicker').is(':visible')) {
2495
+ this.date(d.clone().subtract(1, 'y'));
2496
+ } else {
2497
+ this.date(d.clone().add(1, 'h'));
2498
+ }
2499
+ },
2500
+ 'control down': function (widget) {
2501
+ if (!widget) {
2502
+ return;
2503
+ }
2504
+ var d = this.date() || this.getMoment();
2505
+ if (widget.find('.datepicker').is(':visible')) {
2506
+ this.date(d.clone().add(1, 'y'));
2507
+ } else {
2508
+ this.date(d.clone().subtract(1, 'h'));
2509
+ }
2510
+ },
2511
+ left: function (widget) {
2512
+ if (!widget) {
2513
+ return;
2514
+ }
2515
+ var d = this.date() || this.getMoment();
2516
+ if (widget.find('.datepicker').is(':visible')) {
2517
+ this.date(d.clone().subtract(1, 'd'));
2518
+ }
2519
+ },
2520
+ right: function (widget) {
2521
+ if (!widget) {
2522
+ return;
2523
+ }
2524
+ var d = this.date() || this.getMoment();
2525
+ if (widget.find('.datepicker').is(':visible')) {
2526
+ this.date(d.clone().add(1, 'd'));
2527
+ }
2528
+ },
2529
+ pageUp: function (widget) {
2530
+ if (!widget) {
2531
+ return;
2532
+ }
2533
+ var d = this.date() || this.getMoment();
2534
+ if (widget.find('.datepicker').is(':visible')) {
2535
+ this.date(d.clone().subtract(1, 'M'));
2536
+ }
2537
+ },
2538
+ pageDown: function (widget) {
2539
+ if (!widget) {
2540
+ return;
2541
+ }
2542
+ var d = this.date() || this.getMoment();
2543
+ if (widget.find('.datepicker').is(':visible')) {
2544
+ this.date(d.clone().add(1, 'M'));
2545
+ }
2546
+ },
2547
+ enter: function () {
2548
+ this.hide();
2549
+ },
2550
+ escape: function () {
2551
+ this.hide();
2552
+ },
2553
+ //tab: function (widget) { //this break the flow of the form. disabling for now
2554
+ // var toggle = widget.find('.picker-switch a[data-action="togglePicker"]');
2555
+ // if(toggle.length > 0) toggle.click();
2556
+ //},
2557
+ 'control space': function (widget) {
2558
+ if (widget.find('.timepicker').is(':visible')) {
2559
+ widget.find('.btn[data-action="togglePeriod"]').click();
2560
+ }
2561
+ },
2562
+ t: function () {
2563
+ this.date(this.getMoment());
2564
+ },
2565
+ 'delete': function () {
2566
+ this.clear();
2567
+ }
2568
+ },
2569
+ debug: false,
2570
+ allowInputToggle: false,
2571
+ disabledTimeIntervals: false,
2572
+ disabledHours: false,
2573
+ enabledHours: false,
2574
+ viewDate: false
2575
+ };
2576
+ }));