ad2games-ui_components 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (460) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +28 -0
  4. data/app/assets/javascripts/ui_components.js.erb +26 -0
  5. data/app/assets/javascripts/ui_components/chosen_init.coffee +9 -0
  6. data/app/assets/javascripts/ui_components/domchange.coffee +1 -0
  7. data/app/assets/javascripts/ui_components/hide_empty_dropdowns.coffee +4 -0
  8. data/app/assets/javascripts/ui_components/modal.coffee +1 -0
  9. data/app/assets/javascripts/ui_components/navbar.coffee +2 -0
  10. data/app/assets/javascripts/ui_components/sticky_header.coffee +24 -0
  11. data/app/assets/javascripts/ui_components/submit_on_change.coffee +3 -0
  12. data/app/assets/javascripts/ui_components/turbolinks_progressbar.coffee +2 -0
  13. data/app/assets/stylesheets/a2g_ui_components.scss +8 -0
  14. data/app/assets/stylesheets/default_theme/button.scss +160 -0
  15. data/app/assets/stylesheets/default_theme/common.scss +15 -0
  16. data/app/assets/stylesheets/default_theme/footer.scss +7 -0
  17. data/app/assets/stylesheets/default_theme/form.scss +72 -0
  18. data/app/assets/stylesheets/default_theme/navbar.scss +55 -0
  19. data/app/assets/stylesheets/default_theme/table.scss +68 -0
  20. data/app/assets/stylesheets/default_theme/toolbar.scss +117 -0
  21. data/app/assets/stylesheets/libs.scss +6 -0
  22. data/app/assets/stylesheets/ui_components.scss.erb +15 -0
  23. data/app/assets/stylesheets/ui_components/checkbox_list.scss +11 -0
  24. data/app/assets/stylesheets/ui_components/date_range.scss +5 -0
  25. data/app/assets/stylesheets/ui_components/markdown_textarea.scss +7 -0
  26. data/app/assets/stylesheets/variables.scss +893 -0
  27. data/app/cells/checkbox_list/checkbox_list.yml +7 -0
  28. data/app/cells/checkbox_list/checkbox_list_cell.rb +33 -0
  29. data/app/cells/datagrid_filter/datagrid_filter.yml +14 -0
  30. data/app/cells/datagrid_filter/datagrid_filter_cell.rb +35 -0
  31. data/app/cells/date_range/date_range.coffee +69 -0
  32. data/app/cells/date_range/date_range.yml +7 -0
  33. data/app/cells/date_range/date_range_cell.rb +55 -0
  34. data/app/cells/form_cell_base.rb +26 -0
  35. data/app/cells/hello_world/hello_world.slim +1 -0
  36. data/app/cells/hello_world/hello_world.yml +5 -0
  37. data/app/cells/hello_world/hello_world_cell.rb +4 -0
  38. data/app/cells/markdown_readonly/markdown_readonly.coffee +5 -0
  39. data/app/cells/markdown_readonly/markdown_readonly.slim +1 -0
  40. data/app/cells/markdown_readonly/markdown_readonly.yml +4 -0
  41. data/app/cells/markdown_readonly/markdown_readonly_cell.rb +4 -0
  42. data/app/cells/markdown_textarea/markdown_textarea.coffee +9 -0
  43. data/app/cells/markdown_textarea/markdown_textarea.slim +9 -0
  44. data/app/cells/markdown_textarea/markdown_textarea.yml +8 -0
  45. data/app/cells/markdown_textarea/markdown_textarea_cell.rb +42 -0
  46. data/app/cells/modal/modal.coffee +2 -0
  47. data/app/cells/modal/modal.slim +12 -0
  48. data/app/cells/modal/modal.yml +22 -0
  49. data/app/cells/modal/modal_cell.rb +31 -0
  50. data/app/cells/select/select.coffee +35 -0
  51. data/app/cells/select/select.yml +14 -0
  52. data/app/cells/select/select_cell.rb +59 -0
  53. data/app/helpers/ui_components/view_helper.rb +8 -0
  54. data/lib/generators/generate_component.thor +32 -0
  55. data/lib/tasks/styleguide.rake +8 -0
  56. data/lib/ui_components.rb +14 -0
  57. data/lib/ui_components/cell.rb +16 -0
  58. data/lib/ui_components/cell_attributes.rb +49 -0
  59. data/lib/ui_components/docu_cop.rb +31 -0
  60. data/lib/ui_components/engine.rb +26 -0
  61. data/lib/ui_components/form_helper.rb +32 -0
  62. data/lib/ui_components/templates/cell.tt +2 -0
  63. data/lib/ui_components/templates/coffee.tt +0 -0
  64. data/lib/ui_components/templates/config.tt +9 -0
  65. data/lib/ui_components/templates/sass.tt +0 -0
  66. data/lib/ui_components/templates/view.tt +0 -0
  67. data/vendor/assets/bower_components/ajax-chosen/CHANGELOG.md +10 -0
  68. data/vendor/assets/bower_components/ajax-chosen/Cakefile +93 -0
  69. data/vendor/assets/bower_components/ajax-chosen/Makefile +2 -0
  70. data/vendor/assets/bower_components/ajax-chosen/README.md +131 -0
  71. data/vendor/assets/bower_components/ajax-chosen/VERSION +1 -0
  72. data/vendor/assets/bower_components/ajax-chosen/bower.json +23 -0
  73. data/vendor/assets/bower_components/ajax-chosen/data.json +57 -0
  74. data/vendor/assets/bower_components/ajax-chosen/docs/ajax-chosen.html +71 -0
  75. data/vendor/assets/bower_components/ajax-chosen/docs/docco.css +186 -0
  76. data/vendor/assets/bower_components/ajax-chosen/index.html +47 -0
  77. data/vendor/assets/bower_components/ajax-chosen/lib/ajax-chosen.js +159 -0
  78. data/vendor/assets/bower_components/ajax-chosen/lib/ajax-chosen.min.js +17 -0
  79. data/vendor/assets/bower_components/ajax-chosen/package.json +18 -0
  80. data/vendor/assets/bower_components/ajax-chosen/src/ajax-chosen.coffee +183 -0
  81. data/vendor/assets/bower_components/bootstrap-chosen/README.md +29 -0
  82. data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen-variables.less +24 -0
  83. data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen-variables.scss +16 -0
  84. data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen.less +473 -0
  85. data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen.scss +459 -0
  86. data/vendor/assets/bower_components/bootstrap-chosen/bower.json +25 -0
  87. data/vendor/assets/bower_components/bootstrap-chosen/chosen-sprite.png +0 -0
  88. data/vendor/assets/bower_components/bootstrap-chosen/chosen-sprite@2x.png +0 -0
  89. data/vendor/assets/bower_components/bootstrap-daterangepicker/README.md +200 -0
  90. data/vendor/assets/bower_components/bootstrap-daterangepicker/bower.json +20 -0
  91. data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker-bs2.css +303 -0
  92. data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker-bs3.css +335 -0
  93. data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker.js +1348 -0
  94. data/vendor/assets/bower_components/bootstrap-daterangepicker/examples.html +272 -0
  95. data/vendor/assets/bower_components/bootstrap-daterangepicker/package.js +18 -0
  96. data/vendor/assets/bower_components/bootstrap-daterangepicker/package.json +32 -0
  97. data/vendor/assets/bower_components/chosen/bower.json +50 -0
  98. data/vendor/assets/bower_components/chosen/chosen-sprite.png +0 -0
  99. data/vendor/assets/bower_components/chosen/chosen-sprite@2x.png +0 -0
  100. data/vendor/assets/bower_components/chosen/chosen.css +448 -0
  101. data/vendor/assets/bower_components/chosen/chosen.jquery.js +1272 -0
  102. data/vendor/assets/bower_components/highlightjs/LICENSE +24 -0
  103. data/vendor/assets/bower_components/highlightjs/Makefile +21 -0
  104. data/vendor/assets/bower_components/highlightjs/README.md +12 -0
  105. data/vendor/assets/bower_components/highlightjs/bower.json +14 -0
  106. data/vendor/assets/bower_components/highlightjs/component.json +12 -0
  107. data/vendor/assets/bower_components/highlightjs/composer.json +26 -0
  108. data/vendor/assets/bower_components/highlightjs/highlight.pack.js +15263 -0
  109. data/vendor/assets/bower_components/highlightjs/highlight.pack.min.js +12 -0
  110. data/vendor/assets/bower_components/highlightjs/package.json +8 -0
  111. data/vendor/assets/bower_components/highlightjs/styles/agate.css +108 -0
  112. data/vendor/assets/bower_components/highlightjs/styles/androidstudio.css +66 -0
  113. data/vendor/assets/bower_components/highlightjs/styles/arduino-light.css +88 -0
  114. data/vendor/assets/bower_components/highlightjs/styles/arta.css +73 -0
  115. data/vendor/assets/bower_components/highlightjs/styles/ascetic.css +45 -0
  116. data/vendor/assets/bower_components/highlightjs/styles/atelier-cave-dark.css +83 -0
  117. data/vendor/assets/bower_components/highlightjs/styles/atelier-cave-light.css +85 -0
  118. data/vendor/assets/bower_components/highlightjs/styles/atelier-cave.dark.css +113 -0
  119. data/vendor/assets/bower_components/highlightjs/styles/atelier-cave.light.css +113 -0
  120. data/vendor/assets/bower_components/highlightjs/styles/atelier-dune-dark.css +69 -0
  121. data/vendor/assets/bower_components/highlightjs/styles/atelier-dune-light.css +69 -0
  122. data/vendor/assets/bower_components/highlightjs/styles/atelier-dune.dark.css +94 -0
  123. data/vendor/assets/bower_components/highlightjs/styles/atelier-dune.light.css +94 -0
  124. data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary-dark.css +84 -0
  125. data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary-light.css +84 -0
  126. data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary.dark.css +113 -0
  127. data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary.light.css +113 -0
  128. data/vendor/assets/bower_components/highlightjs/styles/atelier-forest-dark.css +69 -0
  129. data/vendor/assets/bower_components/highlightjs/styles/atelier-forest-light.css +69 -0
  130. data/vendor/assets/bower_components/highlightjs/styles/atelier-forest.dark.css +94 -0
  131. data/vendor/assets/bower_components/highlightjs/styles/atelier-forest.light.css +94 -0
  132. data/vendor/assets/bower_components/highlightjs/styles/atelier-heath-dark.css +69 -0
  133. data/vendor/assets/bower_components/highlightjs/styles/atelier-heath-light.css +69 -0
  134. data/vendor/assets/bower_components/highlightjs/styles/atelier-heath.dark.css +94 -0
  135. data/vendor/assets/bower_components/highlightjs/styles/atelier-heath.light.css +94 -0
  136. data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside-dark.css +69 -0
  137. data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside-light.css +69 -0
  138. data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside.dark.css +94 -0
  139. data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside.light.css +94 -0
  140. data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau-dark.css +84 -0
  141. data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau-light.css +84 -0
  142. data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau.dark.css +113 -0
  143. data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau.light.css +113 -0
  144. data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna-dark.css +84 -0
  145. data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna-light.css +84 -0
  146. data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna.dark.css +113 -0
  147. data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna.light.css +113 -0
  148. data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside-dark.css +69 -0
  149. data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside-light.css +69 -0
  150. data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside.dark.css +94 -0
  151. data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside.light.css +94 -0
  152. data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool-dark.css +69 -0
  153. data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool-light.css +69 -0
  154. data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool.dark.css +94 -0
  155. data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool.light.css +94 -0
  156. data/vendor/assets/bower_components/highlightjs/styles/brown-paper.css +64 -0
  157. data/vendor/assets/bower_components/highlightjs/styles/brown-papersq.png +0 -0
  158. data/vendor/assets/bower_components/highlightjs/styles/brown_paper.css +103 -0
  159. data/vendor/assets/bower_components/highlightjs/styles/brown_papersq.png +0 -0
  160. data/vendor/assets/bower_components/highlightjs/styles/codepen-embed.css +60 -0
  161. data/vendor/assets/bower_components/highlightjs/styles/color-brewer.css +71 -0
  162. data/vendor/assets/bower_components/highlightjs/styles/dark.css +63 -0
  163. data/vendor/assets/bower_components/highlightjs/styles/darkula.css +74 -0
  164. data/vendor/assets/bower_components/highlightjs/styles/default.css +99 -0
  165. data/vendor/assets/bower_components/highlightjs/styles/docco.css +97 -0
  166. data/vendor/assets/bower_components/highlightjs/styles/dracula.css +76 -0
  167. data/vendor/assets/bower_components/highlightjs/styles/far.css +71 -0
  168. data/vendor/assets/bower_components/highlightjs/styles/foundation.css +88 -0
  169. data/vendor/assets/bower_components/highlightjs/styles/github-gist.css +71 -0
  170. data/vendor/assets/bower_components/highlightjs/styles/github.css +99 -0
  171. data/vendor/assets/bower_components/highlightjs/styles/googlecode.css +89 -0
  172. data/vendor/assets/bower_components/highlightjs/styles/grayscale.css +101 -0
  173. data/vendor/assets/bower_components/highlightjs/styles/gruvbox-dark.css +108 -0
  174. data/vendor/assets/bower_components/highlightjs/styles/gruvbox-light.css +108 -0
  175. data/vendor/assets/bower_components/highlightjs/styles/hopscotch.css +83 -0
  176. data/vendor/assets/bower_components/highlightjs/styles/hybrid.css +102 -0
  177. data/vendor/assets/bower_components/highlightjs/styles/idea.css +97 -0
  178. data/vendor/assets/bower_components/highlightjs/styles/ir-black.css +73 -0
  179. data/vendor/assets/bower_components/highlightjs/styles/ir_black.css +106 -0
  180. data/vendor/assets/bower_components/highlightjs/styles/kimbie.dark.css +74 -0
  181. data/vendor/assets/bower_components/highlightjs/styles/kimbie.light.css +74 -0
  182. data/vendor/assets/bower_components/highlightjs/styles/magula.css +70 -0
  183. data/vendor/assets/bower_components/highlightjs/styles/mono-blue.css +59 -0
  184. data/vendor/assets/bower_components/highlightjs/styles/monokai-sublime.css +83 -0
  185. data/vendor/assets/bower_components/highlightjs/styles/monokai.css +70 -0
  186. data/vendor/assets/bower_components/highlightjs/styles/monokai_sublime.css +154 -0
  187. data/vendor/assets/bower_components/highlightjs/styles/obsidian.css +88 -0
  188. data/vendor/assets/bower_components/highlightjs/styles/paraiso-dark.css +72 -0
  189. data/vendor/assets/bower_components/highlightjs/styles/paraiso-light.css +72 -0
  190. data/vendor/assets/bower_components/highlightjs/styles/paraiso.dark.css +96 -0
  191. data/vendor/assets/bower_components/highlightjs/styles/paraiso.light.css +96 -0
  192. data/vendor/assets/bower_components/highlightjs/styles/pojoaque.css +83 -0
  193. data/vendor/assets/bower_components/highlightjs/styles/pojoaque.jpg +0 -0
  194. data/vendor/assets/bower_components/highlightjs/styles/qtcreator_dark.css +83 -0
  195. data/vendor/assets/bower_components/highlightjs/styles/qtcreator_light.css +83 -0
  196. data/vendor/assets/bower_components/highlightjs/styles/railscasts.css +106 -0
  197. data/vendor/assets/bower_components/highlightjs/styles/rainbow.css +85 -0
  198. data/vendor/assets/bower_components/highlightjs/styles/school-book.css +72 -0
  199. data/vendor/assets/bower_components/highlightjs/styles/school-book.png +0 -0
  200. data/vendor/assets/bower_components/highlightjs/styles/school_book.css +111 -0
  201. data/vendor/assets/bower_components/highlightjs/styles/school_book.png +0 -0
  202. data/vendor/assets/bower_components/highlightjs/styles/solarized-dark.css +84 -0
  203. data/vendor/assets/bower_components/highlightjs/styles/solarized-light.css +84 -0
  204. data/vendor/assets/bower_components/highlightjs/styles/solarized_dark.css +107 -0
  205. data/vendor/assets/bower_components/highlightjs/styles/solarized_light.css +107 -0
  206. data/vendor/assets/bower_components/highlightjs/styles/sunburst.css +102 -0
  207. data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-blue.css +75 -0
  208. data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-bright.css +74 -0
  209. data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-eighties.css +74 -0
  210. data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night.css +75 -0
  211. data/vendor/assets/bower_components/highlightjs/styles/tomorrow.css +72 -0
  212. data/vendor/assets/bower_components/highlightjs/styles/vs.css +68 -0
  213. data/vendor/assets/bower_components/highlightjs/styles/xcode.css +93 -0
  214. data/vendor/assets/bower_components/highlightjs/styles/zenburn.css +80 -0
  215. data/vendor/assets/bower_components/jquery.floatThead/CONTRIBUTING.md +33 -0
  216. data/vendor/assets/bower_components/jquery.floatThead/README.md +285 -0
  217. data/vendor/assets/bower_components/jquery.floatThead/bower.json +34 -0
  218. data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead-slim.js +899 -0
  219. data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead-slim.min.js +3 -0
  220. data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead.js +964 -0
  221. data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead.min.js +3 -0
  222. data/vendor/assets/bower_components/jquery.floatThead/license.txt +21 -0
  223. data/vendor/assets/bower_components/jquery/AUTHORS.txt +278 -0
  224. data/vendor/assets/bower_components/jquery/LICENSE.txt +36 -0
  225. data/vendor/assets/bower_components/jquery/README.md +65 -0
  226. data/vendor/assets/bower_components/jquery/bower.json +14 -0
  227. data/vendor/assets/bower_components/jquery/dist/jquery.js +9842 -0
  228. data/vendor/assets/bower_components/jquery/dist/jquery.min.js +4 -0
  229. data/vendor/assets/bower_components/jquery/dist/jquery.min.map +1 -0
  230. data/vendor/assets/bower_components/jquery/dist/jquery.slim.js +7877 -0
  231. data/vendor/assets/bower_components/jquery/dist/jquery.slim.min.js +4 -0
  232. data/vendor/assets/bower_components/jquery/dist/jquery.slim.min.map +1 -0
  233. data/vendor/assets/bower_components/jquery/sizzle/LICENSE.txt +36 -0
  234. data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.js +2143 -0
  235. data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.min.js +3 -0
  236. data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.min.map +1 -0
  237. data/vendor/assets/bower_components/jquery/src/ajax.js +845 -0
  238. data/vendor/assets/bower_components/jquery/src/ajax/jsonp.js +100 -0
  239. data/vendor/assets/bower_components/jquery/src/ajax/load.js +83 -0
  240. data/vendor/assets/bower_components/jquery/src/ajax/parseJSON.js +13 -0
  241. data/vendor/assets/bower_components/jquery/src/ajax/parseXML.js +27 -0
  242. data/vendor/assets/bower_components/jquery/src/ajax/script.js +68 -0
  243. data/vendor/assets/bower_components/jquery/src/ajax/var/location.js +3 -0
  244. data/vendor/assets/bower_components/jquery/src/ajax/var/nonce.js +5 -0
  245. data/vendor/assets/bower_components/jquery/src/ajax/var/rquery.js +3 -0
  246. data/vendor/assets/bower_components/jquery/src/ajax/xhr.js +167 -0
  247. data/vendor/assets/bower_components/jquery/src/attributes.js +11 -0
  248. data/vendor/assets/bower_components/jquery/src/attributes/attr.js +142 -0
  249. data/vendor/assets/bower_components/jquery/src/attributes/classes.js +177 -0
  250. data/vendor/assets/bower_components/jquery/src/attributes/prop.js +125 -0
  251. data/vendor/assets/bower_components/jquery/src/attributes/support.js +36 -0
  252. data/vendor/assets/bower_components/jquery/src/attributes/val.js +177 -0
  253. data/vendor/assets/bower_components/jquery/src/callbacks.js +232 -0
  254. data/vendor/assets/bower_components/jquery/src/core.js +494 -0
  255. data/vendor/assets/bower_components/jquery/src/core/DOMEval.js +14 -0
  256. data/vendor/assets/bower_components/jquery/src/core/access.js +65 -0
  257. data/vendor/assets/bower_components/jquery/src/core/init.js +134 -0
  258. data/vendor/assets/bower_components/jquery/src/core/parseHTML.js +41 -0
  259. data/vendor/assets/bower_components/jquery/src/core/ready.js +103 -0
  260. data/vendor/assets/bower_components/jquery/src/core/support.js +18 -0
  261. data/vendor/assets/bower_components/jquery/src/core/var/rsingleTag.js +5 -0
  262. data/vendor/assets/bower_components/jquery/src/css.js +515 -0
  263. data/vendor/assets/bower_components/jquery/src/css/addGetHookIf.js +24 -0
  264. data/vendor/assets/bower_components/jquery/src/css/adjustCSS.js +65 -0
  265. data/vendor/assets/bower_components/jquery/src/css/curCSS.js +60 -0
  266. data/vendor/assets/bower_components/jquery/src/css/defaultDisplay.js +72 -0
  267. data/vendor/assets/bower_components/jquery/src/css/hiddenVisibleSelectors.js +18 -0
  268. data/vendor/assets/bower_components/jquery/src/css/showHide.js +48 -0
  269. data/vendor/assets/bower_components/jquery/src/css/support.js +121 -0
  270. data/vendor/assets/bower_components/jquery/src/css/var/cssExpand.js +3 -0
  271. data/vendor/assets/bower_components/jquery/src/css/var/getStyles.js +15 -0
  272. data/vendor/assets/bower_components/jquery/src/css/var/isHidden.js +16 -0
  273. data/vendor/assets/bower_components/jquery/src/css/var/rmargin.js +3 -0
  274. data/vendor/assets/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
  275. data/vendor/assets/bower_components/jquery/src/css/var/swap.js +24 -0
  276. data/vendor/assets/bower_components/jquery/src/data.js +187 -0
  277. data/vendor/assets/bower_components/jquery/src/data/Data.js +200 -0
  278. data/vendor/assets/bower_components/jquery/src/data/accepts.js +20 -0
  279. data/vendor/assets/bower_components/jquery/src/data/support.js +23 -0
  280. data/vendor/assets/bower_components/jquery/src/data/var/acceptData.js +18 -0
  281. data/vendor/assets/bower_components/jquery/src/data/var/dataPriv.js +5 -0
  282. data/vendor/assets/bower_components/jquery/src/data/var/dataUser.js +5 -0
  283. data/vendor/assets/bower_components/jquery/src/deferred.js +158 -0
  284. data/vendor/assets/bower_components/jquery/src/deferred/exceptionHook.js +19 -0
  285. data/vendor/assets/bower_components/jquery/src/deprecated.js +32 -0
  286. data/vendor/assets/bower_components/jquery/src/dimensions.js +54 -0
  287. data/vendor/assets/bower_components/jquery/src/effects.js +629 -0
  288. data/vendor/assets/bower_components/jquery/src/effects/Tween.js +121 -0
  289. data/vendor/assets/bower_components/jquery/src/effects/animatedSelector.js +13 -0
  290. data/vendor/assets/bower_components/jquery/src/effects/support.js +58 -0
  291. data/vendor/assets/bower_components/jquery/src/event.js +710 -0
  292. data/vendor/assets/bower_components/jquery/src/event/ajax.js +20 -0
  293. data/vendor/assets/bower_components/jquery/src/event/alias.js +27 -0
  294. data/vendor/assets/bower_components/jquery/src/event/focusin.js +53 -0
  295. data/vendor/assets/bower_components/jquery/src/event/support.js +9 -0
  296. data/vendor/assets/bower_components/jquery/src/event/trigger.js +199 -0
  297. data/vendor/assets/bower_components/jquery/src/exports/amd.js +24 -0
  298. data/vendor/assets/bower_components/jquery/src/exports/global.js +26 -0
  299. data/vendor/assets/bower_components/jquery/src/intro.js +44 -0
  300. data/vendor/assets/bower_components/jquery/src/jquery.js +37 -0
  301. data/vendor/assets/bower_components/jquery/src/manipulation.js +481 -0
  302. data/vendor/assets/bower_components/jquery/src/manipulation/_evalUrl.js +20 -0
  303. data/vendor/assets/bower_components/jquery/src/manipulation/buildFragment.js +102 -0
  304. data/vendor/assets/bower_components/jquery/src/manipulation/createSafeFragment.js +20 -0
  305. data/vendor/assets/bower_components/jquery/src/manipulation/getAll.js +21 -0
  306. data/vendor/assets/bower_components/jquery/src/manipulation/setGlobalEval.js +20 -0
  307. data/vendor/assets/bower_components/jquery/src/manipulation/support.js +33 -0
  308. data/vendor/assets/bower_components/jquery/src/manipulation/var/nodeNames.js +5 -0
  309. data/vendor/assets/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
  310. data/vendor/assets/bower_components/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
  311. data/vendor/assets/bower_components/jquery/src/manipulation/var/rscriptType.js +3 -0
  312. data/vendor/assets/bower_components/jquery/src/manipulation/var/rtagName.js +3 -0
  313. data/vendor/assets/bower_components/jquery/src/manipulation/wrapMap.js +27 -0
  314. data/vendor/assets/bower_components/jquery/src/offset.js +218 -0
  315. data/vendor/assets/bower_components/jquery/src/outro.js +2 -0
  316. data/vendor/assets/bower_components/jquery/src/queue.js +143 -0
  317. data/vendor/assets/bower_components/jquery/src/queue/delay.js +22 -0
  318. data/vendor/assets/bower_components/jquery/src/selector-native.js +211 -0
  319. data/vendor/assets/bower_components/jquery/src/selector-sizzle.js +14 -0
  320. data/vendor/assets/bower_components/jquery/src/selector.js +1 -0
  321. data/vendor/assets/bower_components/jquery/src/serialize.js +125 -0
  322. data/vendor/assets/bower_components/jquery/src/support.js +63 -0
  323. data/vendor/assets/bower_components/jquery/src/traversing.js +175 -0
  324. data/vendor/assets/bower_components/jquery/src/traversing/findFilter.js +100 -0
  325. data/vendor/assets/bower_components/jquery/src/traversing/var/dir.js +20 -0
  326. data/vendor/assets/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
  327. data/vendor/assets/bower_components/jquery/src/traversing/var/siblings.js +15 -0
  328. data/vendor/assets/bower_components/jquery/src/var/arr.js +3 -0
  329. data/vendor/assets/bower_components/jquery/src/var/class2type.js +5 -0
  330. data/vendor/assets/bower_components/jquery/src/var/concat.js +5 -0
  331. data/vendor/assets/bower_components/jquery/src/var/deletedIds.js +3 -0
  332. data/vendor/assets/bower_components/jquery/src/var/document.js +3 -0
  333. data/vendor/assets/bower_components/jquery/src/var/documentElement.js +5 -0
  334. data/vendor/assets/bower_components/jquery/src/var/hasOwn.js +5 -0
  335. data/vendor/assets/bower_components/jquery/src/var/indexOf.js +5 -0
  336. data/vendor/assets/bower_components/jquery/src/var/pnum.js +3 -0
  337. data/vendor/assets/bower_components/jquery/src/var/push.js +5 -0
  338. data/vendor/assets/bower_components/jquery/src/var/rcssNum.js +7 -0
  339. data/vendor/assets/bower_components/jquery/src/var/rnotwhite.js +3 -0
  340. data/vendor/assets/bower_components/jquery/src/var/slice.js +5 -0
  341. data/vendor/assets/bower_components/jquery/src/var/support.js +5 -0
  342. data/vendor/assets/bower_components/jquery/src/var/toString.js +5 -0
  343. data/vendor/assets/bower_components/jquery/src/wrap.js +79 -0
  344. data/vendor/assets/bower_components/marked/Gulpfile.js +22 -0
  345. data/vendor/assets/bower_components/marked/LICENSE +19 -0
  346. data/vendor/assets/bower_components/marked/Makefile +12 -0
  347. data/vendor/assets/bower_components/marked/README.md +406 -0
  348. data/vendor/assets/bower_components/marked/bin/marked +187 -0
  349. data/vendor/assets/bower_components/marked/bower.json +24 -0
  350. data/vendor/assets/bower_components/marked/component.json +10 -0
  351. data/vendor/assets/bower_components/marked/doc/broken.md +426 -0
  352. data/vendor/assets/bower_components/marked/doc/todo.md +2 -0
  353. data/vendor/assets/bower_components/marked/index.js +1 -0
  354. data/vendor/assets/bower_components/marked/lib/marked.js +1285 -0
  355. data/vendor/assets/bower_components/marked/man/marked.1 +91 -0
  356. data/vendor/assets/bower_components/marked/marked.min.js +6 -0
  357. data/vendor/assets/bower_components/marked/package.json +24 -0
  358. data/vendor/assets/bower_components/moment/CHANGELOG.md +423 -0
  359. data/vendor/assets/bower_components/moment/LICENSE +22 -0
  360. data/vendor/assets/bower_components/moment/Moment.js.nuspec +28 -0
  361. data/vendor/assets/bower_components/moment/README.md +39 -0
  362. data/vendor/assets/bower_components/moment/benchmarks/clone.js +10 -0
  363. data/vendor/assets/bower_components/moment/bower.json +20 -0
  364. data/vendor/assets/bower_components/moment/locale/af.js +71 -0
  365. data/vendor/assets/bower_components/moment/locale/ar-ma.js +57 -0
  366. data/vendor/assets/bower_components/moment/locale/ar-sa.js +101 -0
  367. data/vendor/assets/bower_components/moment/locale/ar-tn.js +55 -0
  368. data/vendor/assets/bower_components/moment/locale/ar.js +134 -0
  369. data/vendor/assets/bower_components/moment/locale/az.js +107 -0
  370. data/vendor/assets/bower_components/moment/locale/be.js +154 -0
  371. data/vendor/assets/bower_components/moment/locale/bg.js +88 -0
  372. data/vendor/assets/bower_components/moment/locale/bn.js +111 -0
  373. data/vendor/assets/bower_components/moment/locale/bo.js +108 -0
  374. data/vendor/assets/bower_components/moment/locale/br.js +109 -0
  375. data/vendor/assets/bower_components/moment/locale/bs.js +140 -0
  376. data/vendor/assets/bower_components/moment/locale/ca.js +77 -0
  377. data/vendor/assets/bower_components/moment/locale/cs.js +157 -0
  378. data/vendor/assets/bower_components/moment/locale/cv.js +61 -0
  379. data/vendor/assets/bower_components/moment/locale/cy.js +79 -0
  380. data/vendor/assets/bower_components/moment/locale/da.js +58 -0
  381. data/vendor/assets/bower_components/moment/locale/de-at.js +74 -0
  382. data/vendor/assets/bower_components/moment/locale/de.js +73 -0
  383. data/vendor/assets/bower_components/moment/locale/el.js +94 -0
  384. data/vendor/assets/bower_components/moment/locale/en-au.js +64 -0
  385. data/vendor/assets/bower_components/moment/locale/en-ca.js +61 -0
  386. data/vendor/assets/bower_components/moment/locale/en-gb.js +65 -0
  387. data/vendor/assets/bower_components/moment/locale/eo.js +71 -0
  388. data/vendor/assets/bower_components/moment/locale/es.js +77 -0
  389. data/vendor/assets/bower_components/moment/locale/et.js +78 -0
  390. data/vendor/assets/bower_components/moment/locale/eu.js +62 -0
  391. data/vendor/assets/bower_components/moment/locale/fa.js +103 -0
  392. data/vendor/assets/bower_components/moment/locale/fi.js +107 -0
  393. data/vendor/assets/bower_components/moment/locale/fo.js +58 -0
  394. data/vendor/assets/bower_components/moment/locale/fr-ca.js +56 -0
  395. data/vendor/assets/bower_components/moment/locale/fr.js +60 -0
  396. data/vendor/assets/bower_components/moment/locale/fy.js +69 -0
  397. data/vendor/assets/bower_components/moment/locale/gl.js +73 -0
  398. data/vendor/assets/bower_components/moment/locale/he.js +80 -0
  399. data/vendor/assets/bower_components/moment/locale/hi.js +121 -0
  400. data/vendor/assets/bower_components/moment/locale/hr.js +141 -0
  401. data/vendor/assets/bower_components/moment/locale/hu.js +111 -0
  402. data/vendor/assets/bower_components/moment/locale/hy-am.js +118 -0
  403. data/vendor/assets/bower_components/moment/locale/id.js +81 -0
  404. data/vendor/assets/bower_components/moment/locale/is.js +126 -0
  405. data/vendor/assets/bower_components/moment/locale/it.js +68 -0
  406. data/vendor/assets/bower_components/moment/locale/ja.js +63 -0
  407. data/vendor/assets/bower_components/moment/locale/ka.js +109 -0
  408. data/vendor/assets/bower_components/moment/locale/km.js +56 -0
  409. data/vendor/assets/bower_components/moment/locale/ko.js +65 -0
  410. data/vendor/assets/bower_components/moment/locale/lb.js +139 -0
  411. data/vendor/assets/bower_components/moment/locale/lt.js +120 -0
  412. data/vendor/assets/bower_components/moment/locale/lv.js +79 -0
  413. data/vendor/assets/bower_components/moment/locale/mk.js +88 -0
  414. data/vendor/assets/bower_components/moment/locale/ml.js +69 -0
  415. data/vendor/assets/bower_components/moment/locale/mr.js +120 -0
  416. data/vendor/assets/bower_components/moment/locale/ms-my.js +80 -0
  417. data/vendor/assets/bower_components/moment/locale/my.js +89 -0
  418. data/vendor/assets/bower_components/moment/locale/nb.js +59 -0
  419. data/vendor/assets/bower_components/moment/locale/ne.js +121 -0
  420. data/vendor/assets/bower_components/moment/locale/nl.js +69 -0
  421. data/vendor/assets/bower_components/moment/locale/nn.js +58 -0
  422. data/vendor/assets/bower_components/moment/locale/pl.js +100 -0
  423. data/vendor/assets/bower_components/moment/locale/pt-br.js +58 -0
  424. data/vendor/assets/bower_components/moment/locale/pt.js +62 -0
  425. data/vendor/assets/bower_components/moment/locale/ro.js +73 -0
  426. data/vendor/assets/bower_components/moment/locale/ru.js +176 -0
  427. data/vendor/assets/bower_components/moment/locale/sk.js +158 -0
  428. data/vendor/assets/bower_components/moment/locale/sl.js +146 -0
  429. data/vendor/assets/bower_components/moment/locale/sq.js +67 -0
  430. data/vendor/assets/bower_components/moment/locale/sr-cyrl.js +107 -0
  431. data/vendor/assets/bower_components/moment/locale/sr.js +107 -0
  432. data/vendor/assets/bower_components/moment/locale/sv.js +65 -0
  433. data/vendor/assets/bower_components/moment/locale/ta.js +130 -0
  434. data/vendor/assets/bower_components/moment/locale/th.js +63 -0
  435. data/vendor/assets/bower_components/moment/locale/tl-ph.js +60 -0
  436. data/vendor/assets/bower_components/moment/locale/tr.js +94 -0
  437. data/vendor/assets/bower_components/moment/locale/tzm-latn.js +56 -0
  438. data/vendor/assets/bower_components/moment/locale/tzm.js +56 -0
  439. data/vendor/assets/bower_components/moment/locale/uk.js +163 -0
  440. data/vendor/assets/bower_components/moment/locale/uz.js +56 -0
  441. data/vendor/assets/bower_components/moment/locale/vi.js +64 -0
  442. data/vendor/assets/bower_components/moment/locale/zh-cn.js +125 -0
  443. data/vendor/assets/bower_components/moment/locale/zh-tw.js +99 -0
  444. data/vendor/assets/bower_components/moment/meteor/README.md +25 -0
  445. data/vendor/assets/bower_components/moment/meteor/export.js +3 -0
  446. data/vendor/assets/bower_components/moment/meteor/test.js +5 -0
  447. data/vendor/assets/bower_components/moment/min/locales.js +7306 -0
  448. data/vendor/assets/bower_components/moment/min/locales.min.js +4 -0
  449. data/vendor/assets/bower_components/moment/min/moment-with-locales.js +9792 -0
  450. data/vendor/assets/bower_components/moment/min/moment-with-locales.min.js +10 -0
  451. data/vendor/assets/bower_components/moment/min/moment.min.js +7 -0
  452. data/vendor/assets/bower_components/moment/moment.js +3043 -0
  453. data/vendor/assets/bower_components/moment/scripts/npm_prepublish.sh +43 -0
  454. data/vendor/assets/bower_components/underscore/LICENSE +23 -0
  455. data/vendor/assets/bower_components/underscore/README.md +22 -0
  456. data/vendor/assets/bower_components/underscore/bower.json +7 -0
  457. data/vendor/assets/bower_components/underscore/underscore-min.js +6 -0
  458. data/vendor/assets/bower_components/underscore/underscore-min.map +1 -0
  459. data/vendor/assets/bower_components/underscore/underscore.js +1548 -0
  460. metadata +782 -0
@@ -0,0 +1,335 @@
1
+ /*!
2
+ * Stylesheet for the Date Range Picker, for use with Bootstrap 3.x
3
+ *
4
+ * Copyright 2013-2015 Dan Grossman ( http://www.dangrossman.info )
5
+ * Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
6
+ *
7
+ * Built for http://www.improvely.com
8
+ */
9
+
10
+ .daterangepicker.dropdown-menu {
11
+ max-width: none;
12
+ z-index: 3000;
13
+ }
14
+
15
+ .daterangepicker.opensleft .ranges, .daterangepicker.opensleft .calendar {
16
+ float: left;
17
+ margin: 4px;
18
+ }
19
+
20
+ .daterangepicker.opensright .ranges, .daterangepicker.opensright .calendar,
21
+ .daterangepicker.openscenter .ranges, .daterangepicker.openscenter .calendar {
22
+ float: right;
23
+ margin: 4px;
24
+ }
25
+
26
+ .daterangepicker.single .ranges, .daterangepicker.single .calendar {
27
+ float: none;
28
+ }
29
+
30
+ .daterangepicker .ranges {
31
+ width: 160px;
32
+ text-align: left;
33
+ }
34
+
35
+ .daterangepicker .ranges .range_inputs>div {
36
+ float: left;
37
+ }
38
+
39
+ .daterangepicker .ranges .range_inputs>div:nth-child(2) {
40
+ padding-left: 11px;
41
+ }
42
+
43
+ .daterangepicker .calendar {
44
+ display: none;
45
+ max-width: 270px;
46
+ }
47
+
48
+ .daterangepicker.show-calendar .calendar {
49
+ display: block;
50
+ }
51
+
52
+ .daterangepicker .calendar.single .calendar-date {
53
+ border: none;
54
+ }
55
+
56
+ .daterangepicker .calendar th, .daterangepicker .calendar td {
57
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
58
+ white-space: nowrap;
59
+ text-align: center;
60
+ min-width: 32px;
61
+ }
62
+
63
+ .daterangepicker .daterangepicker_start_input label,
64
+ .daterangepicker .daterangepicker_end_input label {
65
+ color: #333;
66
+ display: block;
67
+ font-size: 11px;
68
+ font-weight: normal;
69
+ height: 20px;
70
+ line-height: 20px;
71
+ margin-bottom: 2px;
72
+ text-shadow: #fff 1px 1px 0px;
73
+ text-transform: uppercase;
74
+ width: 74px;
75
+ }
76
+
77
+ .daterangepicker .ranges input {
78
+ font-size: 11px;
79
+ }
80
+
81
+ .daterangepicker .ranges .input-mini {
82
+ border: 1px solid #ccc;
83
+ border-radius: 4px;
84
+ color: #555;
85
+ display: block;
86
+ font-size: 11px;
87
+ height: 30px;
88
+ line-height: 30px;
89
+ vertical-align: middle;
90
+ margin: 0 0 10px 0;
91
+ padding: 0 6px;
92
+ width: 74px;
93
+ }
94
+
95
+ .daterangepicker .ranges ul {
96
+ list-style: none;
97
+ margin: 0;
98
+ padding: 0;
99
+ }
100
+
101
+ .daterangepicker .ranges li {
102
+ font-size: 13px;
103
+ background: #f5f5f5;
104
+ border: 1px solid #f5f5f5;
105
+ color: #08c;
106
+ padding: 3px 12px;
107
+ margin-bottom: 8px;
108
+ -webkit-border-radius: 5px;
109
+ -moz-border-radius: 5px;
110
+ border-radius: 5px;
111
+ cursor: pointer;
112
+ }
113
+
114
+ .daterangepicker .ranges li.active, .daterangepicker .ranges li:hover {
115
+ background: #08c;
116
+ border: 1px solid #08c;
117
+ color: #fff;
118
+ }
119
+
120
+ .daterangepicker .calendar-date {
121
+ border: 1px solid #ddd;
122
+ padding: 4px;
123
+ border-radius: 4px;
124
+ background: #fff;
125
+ }
126
+
127
+ .daterangepicker .calendar-time {
128
+ text-align: center;
129
+ margin: 8px auto 0 auto;
130
+ line-height: 30px;
131
+ }
132
+
133
+ .daterangepicker {
134
+ position: absolute;
135
+ background: #fff;
136
+ top: 100px;
137
+ left: 20px;
138
+ padding: 4px;
139
+ margin-top: 1px;
140
+ -webkit-border-radius: 4px;
141
+ -moz-border-radius: 4px;
142
+ border-radius: 4px;
143
+ }
144
+
145
+ .daterangepicker.opensleft:before {
146
+ position: absolute;
147
+ top: -7px;
148
+ right: 9px;
149
+ display: inline-block;
150
+ border-right: 7px solid transparent;
151
+ border-bottom: 7px solid #ccc;
152
+ border-left: 7px solid transparent;
153
+ border-bottom-color: rgba(0, 0, 0, 0.2);
154
+ content: '';
155
+ }
156
+
157
+ .daterangepicker.opensleft:after {
158
+ position: absolute;
159
+ top: -6px;
160
+ right: 10px;
161
+ display: inline-block;
162
+ border-right: 6px solid transparent;
163
+ border-bottom: 6px solid #fff;
164
+ border-left: 6px solid transparent;
165
+ content: '';
166
+ }
167
+
168
+ .daterangepicker.openscenter:before {
169
+ position: absolute;
170
+ top: -7px;
171
+ left: 0;
172
+ right: 0;
173
+ width: 0;
174
+ margin-left: auto;
175
+ margin-right: auto;
176
+ display: inline-block;
177
+ border-right: 7px solid transparent;
178
+ border-bottom: 7px solid #ccc;
179
+ border-left: 7px solid transparent;
180
+ border-bottom-color: rgba(0, 0, 0, 0.2);
181
+ content: '';
182
+ }
183
+
184
+ .daterangepicker.openscenter:after {
185
+ position: absolute;
186
+ top: -6px;
187
+ left: 0;
188
+ right: 0;
189
+ width: 0;
190
+ margin-left: auto;
191
+ margin-right: auto;
192
+ display: inline-block;
193
+ border-right: 6px solid transparent;
194
+ border-bottom: 6px solid #fff;
195
+ border-left: 6px solid transparent;
196
+ content: '';
197
+ }
198
+
199
+ .daterangepicker.opensright:before {
200
+ position: absolute;
201
+ top: -7px;
202
+ left: 9px;
203
+ display: inline-block;
204
+ border-right: 7px solid transparent;
205
+ border-bottom: 7px solid #ccc;
206
+ border-left: 7px solid transparent;
207
+ border-bottom-color: rgba(0, 0, 0, 0.2);
208
+ content: '';
209
+ }
210
+
211
+ .daterangepicker.opensright:after {
212
+ position: absolute;
213
+ top: -6px;
214
+ left: 10px;
215
+ display: inline-block;
216
+ border-right: 6px solid transparent;
217
+ border-bottom: 6px solid #fff;
218
+ border-left: 6px solid transparent;
219
+ content: '';
220
+ }
221
+
222
+ .daterangepicker.dropup{
223
+ margin-top: -5px;
224
+ }
225
+ .daterangepicker.dropup:before{
226
+ top: initial;
227
+ bottom:-7px;
228
+ border-bottom: initial;
229
+ border-top: 7px solid #ccc;
230
+ }
231
+ .daterangepicker.dropup:after{
232
+ top: initial;
233
+ bottom:-6px;
234
+ border-bottom: initial;
235
+ border-top: 6px solid #fff;
236
+ }
237
+
238
+ .daterangepicker table {
239
+ width: 100%;
240
+ margin: 0;
241
+ }
242
+
243
+ .daterangepicker td, .daterangepicker th {
244
+ text-align: center;
245
+ width: 20px;
246
+ height: 20px;
247
+ -webkit-border-radius: 4px;
248
+ -moz-border-radius: 4px;
249
+ border-radius: 4px;
250
+ cursor: pointer;
251
+ white-space: nowrap;
252
+ }
253
+
254
+ .daterangepicker td.off {
255
+ color: #999;
256
+ }
257
+
258
+ .daterangepicker td.disabled, .daterangepicker option.disabled {
259
+ color: #999;
260
+ }
261
+
262
+ .daterangepicker td.available:hover, .daterangepicker td.available.today, .daterangepicker th.available:hover {
263
+ background: #eee;
264
+ }
265
+
266
+ .daterangepicker td.in-range {
267
+ background: #ebf4f8;
268
+ -webkit-border-radius: 0;
269
+ -moz-border-radius: 0;
270
+ border-radius: 0;
271
+ }
272
+
273
+ .daterangepicker td.start-date {
274
+ -webkit-border-radius: 4px 0 0 4px;
275
+ -moz-border-radius: 4px 0 0 4px;
276
+ border-radius: 4px 0 0 4px;
277
+ }
278
+
279
+ .daterangepicker td.end-date {
280
+ -webkit-border-radius: 0 4px 4px 0;
281
+ -moz-border-radius: 0 4px 4px 0;
282
+ border-radius: 0 4px 4px 0;
283
+ }
284
+
285
+ .daterangepicker td.start-date.end-date {
286
+ -webkit-border-radius: 4px;
287
+ -moz-border-radius: 4px;
288
+ border-radius: 4px;
289
+ }
290
+
291
+ .daterangepicker td.today.active, .daterangepicker td.active, .daterangepicker td.active:hover {
292
+ background-color: #357ebd;
293
+ border-color: #3071a9;
294
+ color: #fff;
295
+ }
296
+
297
+ .daterangepicker td.week, .daterangepicker th.week {
298
+ font-size: 80%;
299
+ color: #ccc;
300
+ }
301
+
302
+ .daterangepicker select.monthselect, .daterangepicker select.yearselect {
303
+ font-size: 12px;
304
+ padding: 1px;
305
+ height: auto;
306
+ margin: 0;
307
+ cursor: default;
308
+ }
309
+
310
+ .daterangepicker select.monthselect {
311
+ margin-right: 2%;
312
+ width: 56%;
313
+ }
314
+
315
+ .daterangepicker select.yearselect {
316
+ width: 40%;
317
+ }
318
+
319
+ .daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
320
+ width: 50px;
321
+ margin-bottom: 0;
322
+ }
323
+
324
+ .daterangepicker_start_input {
325
+ float: left;
326
+ }
327
+
328
+ .daterangepicker_end_input {
329
+ float: left;
330
+ padding-left: 11px
331
+ }
332
+
333
+ .daterangepicker th.month {
334
+ width: auto;
335
+ }
@@ -0,0 +1,1348 @@
1
+ /**
2
+ * @version: 1.3.23
3
+ * @author: Dan Grossman http://www.dangrossman.info/
4
+ * @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved.
5
+ * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
6
+ * @website: https://www.improvely.com/
7
+ */
8
+
9
+ (function(root, factory) {
10
+
11
+ if (typeof define === 'function' && define.amd) {
12
+ define(['moment', 'jquery', 'exports'], function(momentjs, $, exports) {
13
+ root.daterangepicker = factory(root, exports, momentjs, $);
14
+ });
15
+
16
+ } else if (typeof exports !== 'undefined') {
17
+ var momentjs = require('moment');
18
+ var jQuery;
19
+ try {
20
+ jQuery = require('jquery');
21
+ } catch (err) {
22
+ jQuery = window.jQuery;
23
+ if (!jQuery) throw new Error('jQuery dependency not found');
24
+ }
25
+
26
+ factory(root, exports, momentjs, jQuery);
27
+
28
+ // Finally, as a browser global.
29
+ } else {
30
+ root.daterangepicker = factory(root, {}, root.moment || moment, (root.jQuery || root.Zepto || root.ender || root.$));
31
+ }
32
+
33
+ }(this, function(root, daterangepicker, moment, $) {
34
+
35
+ var DateRangePicker = function (element, options, cb) {
36
+
37
+ // by default, the daterangepicker element is placed at the bottom of HTML body
38
+ this.parentEl = 'body';
39
+
40
+ //element that triggered the date range picker
41
+ this.element = $(element);
42
+
43
+ //tracks visible state
44
+ this.isShowing = false;
45
+
46
+ //create the picker HTML object
47
+ var DRPTemplate = '<div class="daterangepicker dropdown-menu">' +
48
+ '<div class="calendar first left"></div>' +
49
+ '<div class="calendar second right"></div>' +
50
+ '<div class="ranges">' +
51
+ '<div class="range_inputs">' +
52
+ '<div class="daterangepicker_start_input">' +
53
+ '<label for="daterangepicker_start"></label>' +
54
+ '<input class="input-mini" type="text" name="daterangepicker_start" value="" />' +
55
+ '</div>' +
56
+ '<div class="daterangepicker_end_input">' +
57
+ '<label for="daterangepicker_end"></label>' +
58
+ '<input class="input-mini" type="text" name="daterangepicker_end" value="" />' +
59
+ '</div>' +
60
+ '<button class="applyBtn" disabled="disabled" type="button"></button>&nbsp;' +
61
+ '<button class="cancelBtn" type="button"></button>' +
62
+ '</div>' +
63
+ '</div>' +
64
+ '</div>';
65
+
66
+ //custom options
67
+ if (typeof options !== 'object' || options === null)
68
+ options = {};
69
+
70
+ this.parentEl = (typeof options === 'object' && options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl);
71
+ this.container = $(DRPTemplate).appendTo(this.parentEl);
72
+
73
+ //allow setting options with data attributes
74
+ //data-api options will be overwritten with custom javascript options
75
+ options = $.extend(this.element.data(), options);
76
+
77
+ this.setOptions(options, cb);
78
+
79
+ //event listeners
80
+ this.container.find('.calendar')
81
+ .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this))
82
+ .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this))
83
+ .on('click.daterangepicker', 'td.available', $.proxy(this.clickDate, this))
84
+ .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this))
85
+ .on('mouseleave.daterangepicker', 'td.available', $.proxy(this.updateFormInputs, this))
86
+ .on('change.daterangepicker', 'select.yearselect', $.proxy(this.updateMonthYear, this))
87
+ .on('change.daterangepicker', 'select.monthselect', $.proxy(this.updateMonthYear, this))
88
+ .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.updateTime, this));
89
+
90
+ this.container.find('.ranges')
91
+ .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this))
92
+ .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this))
93
+ .on('click.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.showCalendars, this))
94
+ .on('change.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.inputsChanged, this))
95
+ .on('keydown.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.inputsKeydown, this))
96
+ .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this))
97
+ .on('mouseenter.daterangepicker', 'li', $.proxy(this.enterRange, this))
98
+ .on('mouseleave.daterangepicker', 'li', $.proxy(this.updateFormInputs, this));
99
+
100
+ if (this.element.is('input')) {
101
+ this.element.on({
102
+ 'click.daterangepicker': $.proxy(this.show, this),
103
+ 'focus.daterangepicker': $.proxy(this.show, this),
104
+ 'keyup.daterangepicker': $.proxy(this.updateFromControl, this),
105
+ 'keydown.daterangepicker': $.proxy(this.keydown, this)
106
+ });
107
+ } else {
108
+ this.element.on('click.daterangepicker', $.proxy(this.toggle, this));
109
+ }
110
+
111
+ };
112
+
113
+ DateRangePicker.prototype = {
114
+
115
+ constructor: DateRangePicker,
116
+
117
+ setOptions: function(options, callback) {
118
+
119
+ this.startDate = moment().startOf('day');
120
+ this.endDate = moment().endOf('day');
121
+ this.timeZone = moment().utcOffset();
122
+ this.minDate = false;
123
+ this.maxDate = false;
124
+ this.dateLimit = false;
125
+
126
+ this.showDropdowns = false;
127
+ this.showWeekNumbers = false;
128
+ this.timePicker = false;
129
+ this.timePickerSeconds = false;
130
+ this.timePickerIncrement = 30;
131
+ this.timePicker12Hour = true;
132
+ this.autoApply = false;
133
+ this.singleDatePicker = false;
134
+ this.ranges = {};
135
+
136
+ this.opens = 'right';
137
+ if (this.element.hasClass('pull-right'))
138
+ this.opens = 'left';
139
+
140
+ this.drops = 'down';
141
+ if (this.element.hasClass('dropup'))
142
+ this.drops = 'up';
143
+
144
+ this.buttonClasses = ['btn', 'btn-small btn-sm'];
145
+ this.applyClass = 'btn-success';
146
+ this.cancelClass = 'btn-default';
147
+
148
+ this.format = 'MM/DD/YYYY';
149
+ this.separator = ' - ';
150
+
151
+ this.locale = {
152
+ applyLabel: 'Apply',
153
+ cancelLabel: 'Cancel',
154
+ fromLabel: 'From',
155
+ toLabel: 'To',
156
+ weekLabel: 'W',
157
+ customRangeLabel: 'Custom Range',
158
+ daysOfWeek: moment.weekdaysMin(),
159
+ monthNames: moment.monthsShort(),
160
+ firstDay: moment.localeData()._week.dow
161
+ };
162
+
163
+ this.cb = function () { };
164
+
165
+ if (typeof options.format === 'string')
166
+ this.format = options.format;
167
+
168
+ if (typeof options.separator === 'string')
169
+ this.separator = options.separator;
170
+
171
+ if (typeof options.startDate === 'string')
172
+ this.startDate = moment(options.startDate, this.format);
173
+
174
+ if (typeof options.endDate === 'string')
175
+ this.endDate = moment(options.endDate, this.format);
176
+
177
+ if (typeof options.minDate === 'string')
178
+ this.minDate = moment(options.minDate, this.format);
179
+
180
+ if (typeof options.maxDate === 'string')
181
+ this.maxDate = moment(options.maxDate, this.format);
182
+
183
+ if (typeof options.startDate === 'object')
184
+ this.startDate = moment(options.startDate);
185
+
186
+ if (typeof options.endDate === 'object')
187
+ this.endDate = moment(options.endDate);
188
+
189
+ if (typeof options.minDate === 'object')
190
+ this.minDate = moment(options.minDate);
191
+
192
+ if (typeof options.maxDate === 'object')
193
+ this.maxDate = moment(options.maxDate);
194
+
195
+ if (typeof options.applyClass === 'string')
196
+ this.applyClass = options.applyClass;
197
+
198
+ if (typeof options.cancelClass === 'string')
199
+ this.cancelClass = options.cancelClass;
200
+
201
+ if (typeof options.dateLimit === 'object')
202
+ this.dateLimit = options.dateLimit;
203
+
204
+ if (typeof options.locale === 'object') {
205
+
206
+ if (typeof options.locale.daysOfWeek === 'object') {
207
+ // Create a copy of daysOfWeek to avoid modification of original
208
+ // options object for reusability in multiple daterangepicker instances
209
+ this.locale.daysOfWeek = options.locale.daysOfWeek.slice();
210
+ }
211
+
212
+ if (typeof options.locale.monthNames === 'object') {
213
+ this.locale.monthNames = options.locale.monthNames.slice();
214
+ }
215
+
216
+ if (typeof options.locale.firstDay === 'number') {
217
+ this.locale.firstDay = options.locale.firstDay;
218
+ }
219
+
220
+ if (typeof options.locale.applyLabel === 'string') {
221
+ this.locale.applyLabel = options.locale.applyLabel;
222
+ }
223
+
224
+ if (typeof options.locale.cancelLabel === 'string') {
225
+ this.locale.cancelLabel = options.locale.cancelLabel;
226
+ }
227
+
228
+ if (typeof options.locale.fromLabel === 'string') {
229
+ this.locale.fromLabel = options.locale.fromLabel;
230
+ }
231
+
232
+ if (typeof options.locale.toLabel === 'string') {
233
+ this.locale.toLabel = options.locale.toLabel;
234
+ }
235
+
236
+ if (typeof options.locale.weekLabel === 'string') {
237
+ this.locale.weekLabel = options.locale.weekLabel;
238
+ }
239
+
240
+ if (typeof options.locale.customRangeLabel === 'string') {
241
+ this.locale.customRangeLabel = options.locale.customRangeLabel;
242
+ }
243
+ }
244
+
245
+ if (typeof options.opens === 'string')
246
+ this.opens = options.opens;
247
+
248
+ if (typeof options.drops === 'string')
249
+ this.drops = options.drops;
250
+
251
+ if (typeof options.showWeekNumbers === 'boolean') {
252
+ this.showWeekNumbers = options.showWeekNumbers;
253
+ }
254
+
255
+ if (typeof options.buttonClasses === 'string') {
256
+ this.buttonClasses = [options.buttonClasses];
257
+ }
258
+
259
+ if (typeof options.buttonClasses === 'object') {
260
+ this.buttonClasses = options.buttonClasses;
261
+ }
262
+
263
+ if (typeof options.showDropdowns === 'boolean') {
264
+ this.showDropdowns = options.showDropdowns;
265
+ }
266
+
267
+ if (typeof options.singleDatePicker === 'boolean') {
268
+ this.singleDatePicker = options.singleDatePicker;
269
+ if (this.singleDatePicker) {
270
+ this.endDate = this.startDate.clone();
271
+ }
272
+ }
273
+
274
+ if (typeof options.timePicker === 'boolean') {
275
+ this.timePicker = options.timePicker;
276
+ }
277
+
278
+ if (typeof options.timePickerSeconds === 'boolean') {
279
+ this.timePickerSeconds = options.timePickerSeconds;
280
+ }
281
+
282
+ if (typeof options.timePickerIncrement === 'number') {
283
+ this.timePickerIncrement = options.timePickerIncrement;
284
+ }
285
+
286
+ if (typeof options.timePicker12Hour === 'boolean') {
287
+ this.timePicker12Hour = options.timePicker12Hour;
288
+ }
289
+
290
+ if (typeof options.autoApply === 'boolean') {
291
+ this.autoApply = options.autoApply;
292
+ if (this.autoApply)
293
+ this.container.find('.applyBtn, .cancelBtn').addClass('hide');
294
+ }
295
+
296
+ // update day names order to firstDay
297
+ if (this.locale.firstDay != 0) {
298
+ var iterator = this.locale.firstDay;
299
+ while (iterator > 0) {
300
+ this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());
301
+ iterator--;
302
+ }
303
+ }
304
+
305
+ var start, end, range;
306
+
307
+ //if no start/end dates set, check if an input element contains initial values
308
+ if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') {
309
+ if ($(this.element).is('input[type=text]')) {
310
+ var val = $(this.element).val(),
311
+ split = val.split(this.separator);
312
+
313
+ start = end = null;
314
+
315
+ if (split.length == 2) {
316
+ start = moment(split[0], this.format);
317
+ end = moment(split[1], this.format);
318
+ } else if (this.singleDatePicker && val !== "") {
319
+ start = moment(val, this.format);
320
+ end = moment(val, this.format);
321
+ }
322
+ if (start !== null && end !== null) {
323
+ this.startDate = start;
324
+ this.endDate = end;
325
+ }
326
+ }
327
+ }
328
+
329
+ // bind the time zone used to build the calendar to either the timeZone passed in through the options or the zone of the startDate (which will be the local time zone by default)
330
+ if (typeof options.timeZone === 'string' || typeof options.timeZone === 'number') {
331
+ if (typeof options.timeZone === 'string' && typeof moment.tz !== 'undefined') {
332
+ this.timeZone = moment.tz.zone(options.timeZone).parse(new Date) * -1; // Offset is positive if the timezone is behind UTC and negative if it is ahead.
333
+ } else {
334
+ this.timeZone = options.timeZone;
335
+ }
336
+ this.startDate.utcOffset(this.timeZone);
337
+ this.endDate.utcOffset(this.timeZone);
338
+ } else {
339
+ this.timeZone = moment(this.startDate).utcOffset();
340
+ }
341
+
342
+ if (typeof options.ranges === 'object') {
343
+ for (range in options.ranges) {
344
+
345
+ if (typeof options.ranges[range][0] === 'string')
346
+ start = moment(options.ranges[range][0], this.format);
347
+ else
348
+ start = moment(options.ranges[range][0]);
349
+
350
+ if (typeof options.ranges[range][1] === 'string')
351
+ end = moment(options.ranges[range][1], this.format);
352
+ else
353
+ end = moment(options.ranges[range][1]);
354
+
355
+ // If we have a min/max date set, bound this range
356
+ // to it, but only if it would otherwise fall
357
+ // outside of the min/max.
358
+ if (this.minDate && start.isBefore(this.minDate))
359
+ start = moment(this.minDate);
360
+
361
+ if (this.maxDate && end.isAfter(this.maxDate))
362
+ end = moment(this.maxDate);
363
+
364
+ // If the end of the range is before the minimum (if min is set) OR
365
+ // the start of the range is after the max (also if set) don't display this
366
+ // range option.
367
+ if ((this.minDate && end.isBefore(this.minDate)) || (this.maxDate && start.isAfter(this.maxDate))) {
368
+ continue;
369
+ }
370
+
371
+ this.ranges[range] = [start, end];
372
+ }
373
+
374
+ var list = '<ul>';
375
+ for (range in this.ranges) {
376
+ list += '<li>' + range + '</li>';
377
+ }
378
+ list += '<li>' + this.locale.customRangeLabel + '</li>';
379
+ list += '</ul>';
380
+ this.container.find('.ranges ul').remove();
381
+ this.container.find('.ranges').prepend(list);
382
+ }
383
+
384
+ if (typeof callback === 'function') {
385
+ this.cb = callback;
386
+ }
387
+
388
+ if (!this.timePicker) {
389
+ this.startDate = this.startDate.startOf('day');
390
+ this.endDate = this.endDate.endOf('day');
391
+ }
392
+
393
+ if (this.singleDatePicker) {
394
+ this.opens = this.opens || 'right';
395
+ this.container.addClass('single');
396
+ this.container.find('.calendar.right').show();
397
+ this.container.find('.calendar.left').hide();
398
+ if (!this.timePicker) {
399
+ this.container.find('.ranges').hide();
400
+ } else {
401
+ this.container.find('.ranges .daterangepicker_start_input, .ranges .daterangepicker_end_input').hide();
402
+ }
403
+ if (!this.container.find('.calendar.right').hasClass('single'))
404
+ this.container.find('.calendar.right').addClass('single');
405
+ } else {
406
+ this.container.removeClass('single');
407
+ this.container.find('.calendar.right').removeClass('single');
408
+ this.container.find('.ranges').show();
409
+ }
410
+
411
+ this.oldStartDate = this.startDate.clone();
412
+ this.oldEndDate = this.endDate.clone();
413
+ this.oldChosenLabel = this.chosenLabel;
414
+
415
+ this.leftCalendar = {
416
+ month: moment([this.startDate.year(), this.startDate.month(), 1, this.startDate.hour(), this.startDate.minute(), this.startDate.second()]),
417
+ calendar: []
418
+ };
419
+
420
+ this.rightCalendar = {
421
+ month: moment([this.endDate.year(), this.endDate.month(), 1, this.endDate.hour(), this.endDate.minute(), this.endDate.second()]),
422
+ calendar: []
423
+ };
424
+
425
+ if (this.opens == 'right' || this.opens == 'center') {
426
+ //swap calendar positions
427
+ var first = this.container.find('.calendar.first');
428
+ var second = this.container.find('.calendar.second');
429
+
430
+ if (second.hasClass('single')) {
431
+ second.removeClass('single');
432
+ first.addClass('single');
433
+ }
434
+
435
+ first.removeClass('left').addClass('right');
436
+ second.removeClass('right').addClass('left');
437
+
438
+ if (this.singleDatePicker) {
439
+ first.show();
440
+ second.hide();
441
+ }
442
+ }
443
+
444
+ if (typeof options.ranges === 'undefined' && !this.singleDatePicker) {
445
+ this.container.addClass('show-calendar');
446
+ }
447
+
448
+ this.container.removeClass('opensleft opensright').addClass('opens' + this.opens);
449
+
450
+ this.updateView();
451
+ this.updateCalendars();
452
+
453
+ //apply CSS classes and labels to buttons
454
+ var c = this.container;
455
+ $.each(this.buttonClasses, function (idx, val) {
456
+ c.find('button').addClass(val);
457
+ });
458
+ this.container.find('.daterangepicker_start_input label').html(this.locale.fromLabel);
459
+ this.container.find('.daterangepicker_end_input label').html(this.locale.toLabel);
460
+ if (this.applyClass.length)
461
+ this.container.find('.applyBtn').addClass(this.applyClass);
462
+ if (this.cancelClass.length)
463
+ this.container.find('.cancelBtn').addClass(this.cancelClass);
464
+ this.container.find('.applyBtn').html(this.locale.applyLabel);
465
+ this.container.find('.cancelBtn').html(this.locale.cancelLabel);
466
+ },
467
+
468
+ setStartDate: function(startDate) {
469
+ if (typeof startDate === 'string')
470
+ this.startDate = moment(startDate, this.format).utcOffset(this.timeZone);
471
+
472
+ if (typeof startDate === 'object')
473
+ this.startDate = moment(startDate);
474
+
475
+ if (!this.timePicker)
476
+ this.startDate = this.startDate.startOf('day');
477
+
478
+ this.oldStartDate = this.startDate.clone();
479
+
480
+ this.updateView();
481
+ this.updateCalendars();
482
+ this.updateInputText();
483
+ },
484
+
485
+ setEndDate: function(endDate) {
486
+ if (typeof endDate === 'string')
487
+ this.endDate = moment(endDate, this.format).utcOffset(this.timeZone);
488
+
489
+ if (typeof endDate === 'object')
490
+ this.endDate = moment(endDate);
491
+
492
+ if (!this.timePicker)
493
+ this.endDate = this.endDate.endOf('day');
494
+
495
+ this.oldEndDate = this.endDate.clone();
496
+
497
+ this.updateView();
498
+ this.updateCalendars();
499
+ this.updateInputText();
500
+ },
501
+
502
+ updateView: function () {
503
+ this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()).hour(this.startDate.hour()).minute(this.startDate.minute());
504
+ this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()).hour(this.endDate.hour()).minute(this.endDate.minute());
505
+ this.updateFormInputs();
506
+ },
507
+
508
+ updateFormInputs: function () {
509
+ this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.format));
510
+ this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.format));
511
+
512
+ if (this.startDate.isSame(this.endDate) || this.startDate.isBefore(this.endDate)) {
513
+ this.container.find('button.applyBtn').removeAttr('disabled');
514
+ } else {
515
+ this.container.find('button.applyBtn').attr('disabled', 'disabled');
516
+ }
517
+ },
518
+
519
+ updateFromControl: function () {
520
+ if (!this.element.is('input')) return;
521
+ if (!this.element.val().length) return;
522
+
523
+ var dateString = this.element.val().split(this.separator),
524
+ start = null,
525
+ end = null;
526
+
527
+ if(dateString.length === 2) {
528
+ start = moment(dateString[0], this.format).utcOffset(this.timeZone);
529
+ end = moment(dateString[1], this.format).utcOffset(this.timeZone);
530
+ }
531
+
532
+ if (this.singleDatePicker || start === null || end === null) {
533
+ start = moment(this.element.val(), this.format).utcOffset(this.timeZone);
534
+ end = start;
535
+ }
536
+
537
+ if (end.isBefore(start)) return;
538
+
539
+ this.oldStartDate = this.startDate.clone();
540
+ this.oldEndDate = this.endDate.clone();
541
+
542
+ this.startDate = start;
543
+ this.endDate = end;
544
+
545
+ if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate))
546
+ this.notify();
547
+
548
+ this.updateCalendars();
549
+ },
550
+
551
+ keydown: function (e) {
552
+ //hide on tab or enter
553
+ if ((e.keyCode === 9) || (e.keyCode === 13)) {
554
+ this.hide();
555
+ }
556
+ },
557
+
558
+ notify: function () {
559
+ this.updateView();
560
+ this.updateInputText();
561
+ this.cb(this.startDate, this.endDate, this.chosenLabel);
562
+ },
563
+
564
+ move: function () {
565
+ var parentOffset = { top: 0, left: 0 },
566
+ containerTop;
567
+ var parentRightEdge = $(window).width();
568
+ if (!this.parentEl.is('body')) {
569
+ parentOffset = {
570
+ top: this.parentEl.offset().top - this.parentEl.scrollTop(),
571
+ left: this.parentEl.offset().left - this.parentEl.scrollLeft()
572
+ };
573
+ parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
574
+ }
575
+
576
+ if (this.drops == 'up')
577
+ containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
578
+ else
579
+ containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
580
+ this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('dropup');
581
+
582
+ if (this.opens == 'left') {
583
+ this.container.css({
584
+ top: containerTop,
585
+ right: parentRightEdge - this.element.offset().left - this.element.outerWidth(),
586
+ left: 'auto'
587
+ });
588
+ if (this.container.offset().left < 0) {
589
+ this.container.css({
590
+ right: 'auto',
591
+ left: 9
592
+ });
593
+ }
594
+ } else if (this.opens == 'center') {
595
+ this.container.css({
596
+ top: containerTop,
597
+ left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
598
+ - this.container.outerWidth() / 2,
599
+ right: 'auto'
600
+ });
601
+ if (this.container.offset().left < 0) {
602
+ this.container.css({
603
+ right: 'auto',
604
+ left: 9
605
+ });
606
+ }
607
+ } else {
608
+ this.container.css({
609
+ top: containerTop,
610
+ left: this.element.offset().left - parentOffset.left,
611
+ right: 'auto'
612
+ });
613
+ if (this.container.offset().left + this.container.outerWidth() > $(window).width()) {
614
+ this.container.css({
615
+ left: 'auto',
616
+ right: 0
617
+ });
618
+ }
619
+ }
620
+ },
621
+
622
+ toggle: function (e) {
623
+ if (this.element.hasClass('active')) {
624
+ this.hide();
625
+ } else {
626
+ this.show();
627
+ }
628
+ },
629
+
630
+ show: function (e) {
631
+ if (this.isShowing) return;
632
+
633
+ this.element.addClass('active');
634
+ this.container.show();
635
+ this.move();
636
+
637
+ // Create a click proxy that is private to this instance of datepicker, for unbinding
638
+ this._outsideClickProxy = $.proxy(function (e) { this.outsideClick(e); }, this);
639
+ // Bind global datepicker mousedown for hiding and
640
+ $(document)
641
+ .on('mousedown.daterangepicker', this._outsideClickProxy)
642
+ // also support mobile devices
643
+ .on('touchend.daterangepicker', this._outsideClickProxy)
644
+ // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
645
+ .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
646
+ // and also close when focus changes to outside the picker (eg. tabbing between controls)
647
+ .on('focusin.daterangepicker', this._outsideClickProxy);
648
+
649
+ this.isShowing = true;
650
+ this.element.trigger('show.daterangepicker', this);
651
+ },
652
+
653
+ outsideClick: function (e) {
654
+ var target = $(e.target);
655
+ // if the page is clicked anywhere except within the daterangerpicker/button
656
+ // itself then call this.hide()
657
+ if (
658
+ // ie modal dialog fix
659
+ e.type == "focusin" ||
660
+ target.closest(this.element).length ||
661
+ target.closest(this.container).length ||
662
+ target.closest('.calendar-date').length
663
+ ) return;
664
+ this.hide();
665
+ },
666
+
667
+ hide: function (e) {
668
+ if (!this.isShowing) return;
669
+
670
+ $(document)
671
+ .off('.daterangepicker');
672
+
673
+ this.element.removeClass('active');
674
+ this.container.hide();
675
+
676
+ if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate))
677
+ this.notify();
678
+
679
+ this.oldStartDate = this.startDate.clone();
680
+ this.oldEndDate = this.endDate.clone();
681
+
682
+ this.isShowing = false;
683
+ this.element.trigger('hide.daterangepicker', this);
684
+ },
685
+
686
+ enterRange: function (e) {
687
+ // mouse pointer has entered a range label
688
+ var label = e.target.innerHTML;
689
+ if (label == this.locale.customRangeLabel) {
690
+ this.updateView();
691
+ } else {
692
+ var dates = this.ranges[label];
693
+ this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.format));
694
+ this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.format));
695
+ }
696
+ },
697
+
698
+ showCalendars: function() {
699
+ this.container.addClass('show-calendar');
700
+ this.move();
701
+ this.element.trigger('showCalendar.daterangepicker', this);
702
+ },
703
+
704
+ hideCalendars: function() {
705
+ this.container.removeClass('show-calendar');
706
+ this.element.trigger('hideCalendar.daterangepicker', this);
707
+ },
708
+
709
+ // when a date is typed into the start to end date textboxes
710
+ inputsChanged: function (e) {
711
+ var el = $(e.target);
712
+ var date = moment(el.val(), this.format);
713
+ if (!date.isValid()) return;
714
+
715
+ var startDate, endDate;
716
+ if (el.attr('name') === 'daterangepicker_start') {
717
+ startDate = (false !== this.minDate && date.isBefore(this.minDate)) ? this.minDate : date;
718
+ endDate = this.endDate;
719
+ if (typeof this.dateLimit === 'object') {
720
+ var maxDate = moment(startDate).add(this.dateLimit).endOf('day');
721
+ if (endDate.isAfter(maxDate)) {
722
+ endDate = maxDate;
723
+ }
724
+ }
725
+ } else {
726
+ startDate = this.startDate;
727
+ endDate = (false !== this.maxDate && date.isAfter(this.maxDate)) ? this.maxDate : date.endOf('day');
728
+ if (typeof this.dateLimit === 'object') {
729
+ var minDate = moment(endDate).subtract(this.dateLimit).startOf('day');
730
+ if (startDate.isBefore(minDate)) {
731
+ startDate = minDate;
732
+ }
733
+ }
734
+ }
735
+ this.setCustomDates(startDate, endDate);
736
+ },
737
+
738
+ inputsKeydown: function(e) {
739
+ if (e.keyCode === 13) {
740
+ this.inputsChanged(e);
741
+ this.notify();
742
+ }
743
+ },
744
+
745
+ updateInputText: function() {
746
+ if (this.element.is('input') && !this.singleDatePicker) {
747
+ this.element.val(this.startDate.format(this.format) + this.separator + this.endDate.format(this.format));
748
+ this.element.trigger('change');
749
+ } else if (this.element.is('input')) {
750
+ this.element.val(this.endDate.format(this.format));
751
+ this.element.trigger('change');
752
+ }
753
+ },
754
+
755
+ clickRange: function (e) {
756
+ var label = e.target.innerHTML;
757
+ this.chosenLabel = label;
758
+ if (label == this.locale.customRangeLabel) {
759
+ this.showCalendars();
760
+ } else {
761
+ var dates = this.ranges[label];
762
+
763
+ this.startDate = dates[0];
764
+ this.endDate = dates[1];
765
+
766
+ if (!this.timePicker) {
767
+ this.startDate.startOf('day');
768
+ this.endDate.endOf('day');
769
+ }
770
+
771
+ this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()).hour(this.startDate.hour()).minute(this.startDate.minute());
772
+ this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()).hour(this.endDate.hour()).minute(this.endDate.minute());
773
+ this.updateCalendars();
774
+
775
+ this.updateInputText();
776
+
777
+ this.hideCalendars();
778
+ this.hide();
779
+ this.element.trigger('apply.daterangepicker', this);
780
+
781
+ if (this.autoApply) {
782
+ this.notify();
783
+ }
784
+
785
+ }
786
+ },
787
+
788
+ clickPrev: function (e) {
789
+ var cal = $(e.target).parents('.calendar');
790
+ if (cal.hasClass('left')) {
791
+ this.leftCalendar.month.subtract(1, 'month');
792
+ } else {
793
+ this.rightCalendar.month.subtract(1, 'month');
794
+ }
795
+ this.updateCalendars();
796
+ },
797
+
798
+ clickNext: function (e) {
799
+ var cal = $(e.target).parents('.calendar');
800
+ if (cal.hasClass('left')) {
801
+ this.leftCalendar.month.add(1, 'month');
802
+ } else {
803
+ this.rightCalendar.month.add(1, 'month');
804
+ }
805
+ this.updateCalendars();
806
+ },
807
+
808
+ hoverDate: function (e) {
809
+ var title = $(e.target).attr('data-title');
810
+ var row = title.substr(1, 1);
811
+ var col = title.substr(3, 1);
812
+ var cal = $(e.target).parents('.calendar');
813
+
814
+ if (cal.hasClass('left')) {
815
+ this.container.find('input[name=daterangepicker_start]').val(this.leftCalendar.calendar[row][col].format(this.format));
816
+ } else {
817
+ this.container.find('input[name=daterangepicker_end]').val(this.rightCalendar.calendar[row][col].format(this.format));
818
+ }
819
+ },
820
+
821
+ setCustomDates: function(startDate, endDate) {
822
+ this.chosenLabel = this.locale.customRangeLabel;
823
+ if (startDate.isAfter(endDate)) {
824
+ var difference = this.endDate.diff(this.startDate);
825
+ endDate = moment(startDate).add(difference, 'ms');
826
+ if (this.maxDate && endDate.isAfter(this.maxDate)) {
827
+ endDate = this.maxDate.clone();
828
+ }
829
+ }
830
+ this.startDate = startDate;
831
+ this.endDate = endDate;
832
+
833
+ this.updateView();
834
+ this.updateCalendars();
835
+
836
+ if (this.autoApply) {
837
+ this.notify();
838
+ this.element.trigger('apply.daterangepicker', this);
839
+ }
840
+ },
841
+
842
+ clickDate: function (e) {
843
+ var title = $(e.target).attr('data-title');
844
+ var row = title.substr(1, 1);
845
+ var col = title.substr(3, 1);
846
+ var cal = $(e.target).parents('.calendar');
847
+
848
+ var startDate, endDate;
849
+ if (cal.hasClass('left')) {
850
+ startDate = this.leftCalendar.calendar[row][col];
851
+ endDate = this.endDate;
852
+ if (typeof this.dateLimit === 'object') {
853
+ var maxDate = moment(startDate).add(this.dateLimit).endOf('day');
854
+ if (endDate.isAfter(maxDate)) {
855
+ endDate = maxDate;
856
+ }
857
+ }
858
+ } else {
859
+ startDate = this.startDate;
860
+ endDate = this.rightCalendar.calendar[row][col];
861
+ if (typeof this.dateLimit === 'object') {
862
+ var minDate = moment(endDate).subtract(this.dateLimit).startOf('day');
863
+ if (startDate.isBefore(minDate)) {
864
+ startDate = minDate;
865
+ }
866
+ }
867
+ }
868
+
869
+ if (this.singleDatePicker && cal.hasClass('left')) {
870
+ endDate = startDate.clone();
871
+ } else if (this.singleDatePicker && cal.hasClass('right')) {
872
+ startDate = endDate.clone();
873
+ }
874
+
875
+ cal.find('td').removeClass('active');
876
+
877
+ $(e.target).addClass('active');
878
+
879
+ this.setCustomDates(startDate, endDate);
880
+
881
+ if (!this.timePicker)
882
+ endDate.endOf('day');
883
+
884
+ if (this.singleDatePicker && !this.timePicker)
885
+ this.clickApply();
886
+ },
887
+
888
+ clickApply: function (e) {
889
+ this.updateInputText();
890
+ this.hide();
891
+ this.element.trigger('apply.daterangepicker', this);
892
+ },
893
+
894
+ clickCancel: function (e) {
895
+ this.startDate = this.oldStartDate;
896
+ this.endDate = this.oldEndDate;
897
+ this.chosenLabel = this.oldChosenLabel;
898
+ this.updateView();
899
+ this.updateCalendars();
900
+ this.hide();
901
+ this.element.trigger('cancel.daterangepicker', this);
902
+ },
903
+
904
+ updateMonthYear: function (e) {
905
+ var isLeft = $(e.target).closest('.calendar').hasClass('left'),
906
+ leftOrRight = isLeft ? 'left' : 'right',
907
+ cal = this.container.find('.calendar.'+leftOrRight);
908
+
909
+ // Month must be Number for new moment versions
910
+ var month = parseInt(cal.find('.monthselect').val(), 10);
911
+ var year = cal.find('.yearselect').val();
912
+
913
+ if (!isLeft && !this.singleDatePicker) {
914
+ if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) {
915
+ month = this.startDate.month();
916
+ year = this.startDate.year();
917
+ }
918
+ }
919
+
920
+ if (this.minDate) {
921
+ if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) {
922
+ month = this.minDate.month();
923
+ year = this.minDate.year();
924
+ }
925
+ }
926
+
927
+ if (this.maxDate) {
928
+ if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) {
929
+ month = this.maxDate.month();
930
+ year = this.maxDate.year();
931
+ }
932
+ }
933
+
934
+
935
+ this[leftOrRight+'Calendar'].month.month(month).year(year);
936
+ this.updateCalendars();
937
+ },
938
+
939
+ updateTime: function(e) {
940
+
941
+ var cal = $(e.target).closest('.calendar'),
942
+ isLeft = cal.hasClass('left');
943
+
944
+ var hour = parseInt(cal.find('.hourselect').val(), 10);
945
+ var minute = parseInt(cal.find('.minuteselect').val(), 10);
946
+ var second = 0;
947
+
948
+ if (this.timePickerSeconds) {
949
+ second = parseInt(cal.find('.secondselect').val(), 10);
950
+ }
951
+
952
+ if (this.timePicker12Hour) {
953
+ var ampm = cal.find('.ampmselect').val();
954
+ if (ampm === 'PM' && hour < 12)
955
+ hour += 12;
956
+ if (ampm === 'AM' && hour === 12)
957
+ hour = 0;
958
+ }
959
+
960
+ if (isLeft) {
961
+ var start = this.startDate.clone();
962
+ start.hour(hour);
963
+ start.minute(minute);
964
+ start.second(second);
965
+ this.startDate = start;
966
+ this.leftCalendar.month.hour(hour).minute(minute).second(second);
967
+ if (this.singleDatePicker)
968
+ this.endDate = start.clone();
969
+ } else {
970
+ var end = this.endDate.clone();
971
+ end.hour(hour);
972
+ end.minute(minute);
973
+ end.second(second);
974
+ this.endDate = end;
975
+ if (this.singleDatePicker)
976
+ this.startDate = end.clone();
977
+ this.rightCalendar.month.hour(hour).minute(minute).second(second);
978
+ }
979
+
980
+ this.updateView();
981
+ this.updateCalendars();
982
+
983
+ if (this.autoApply) {
984
+ this.notify();
985
+ this.element.trigger('apply.daterangepicker', this);
986
+ }
987
+ },
988
+
989
+ updateCalendars: function () {
990
+ this.leftCalendar.calendar = this.buildCalendar(this.leftCalendar.month.month(), this.leftCalendar.month.year(), this.leftCalendar.month.hour(), this.leftCalendar.month.minute(), this.leftCalendar.month.second(), 'left');
991
+ this.rightCalendar.calendar = this.buildCalendar(this.rightCalendar.month.month(), this.rightCalendar.month.year(), this.rightCalendar.month.hour(), this.rightCalendar.month.minute(), this.rightCalendar.month.second(), 'right');
992
+ this.container.find('.calendar.left').empty().html(this.renderCalendar(this.leftCalendar.calendar, this.startDate, this.minDate, this.maxDate, 'left'));
993
+ this.container.find('.calendar.right').empty().html(this.renderCalendar(this.rightCalendar.calendar, this.endDate, this.singleDatePicker ? this.minDate : this.startDate, this.maxDate, 'right'));
994
+
995
+ this.container.find('.ranges li').removeClass('active');
996
+ var customRange = true;
997
+ var i = 0;
998
+ for (var range in this.ranges) {
999
+ if (this.timePicker) {
1000
+ if (this.startDate.isSame(this.ranges[range][0]) && this.endDate.isSame(this.ranges[range][1])) {
1001
+ customRange = false;
1002
+ this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')')
1003
+ .addClass('active').html();
1004
+ }
1005
+ } else {
1006
+ //ignore times when comparing dates if time picker is not enabled
1007
+ if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) {
1008
+ customRange = false;
1009
+ this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')')
1010
+ .addClass('active').html();
1011
+ }
1012
+ }
1013
+ i++;
1014
+ }
1015
+ if (customRange) {
1016
+ this.chosenLabel = this.container.find('.ranges li:last').addClass('active').html();
1017
+ this.showCalendars();
1018
+ }
1019
+ },
1020
+
1021
+ buildCalendar: function (month, year, hour, minute, second, side) {
1022
+ var daysInMonth = moment([year, month]).daysInMonth();
1023
+ var firstDay = moment([year, month, 1]);
1024
+ var lastDay = moment([year, month, daysInMonth]);
1025
+ var lastMonth = moment(firstDay).subtract(1, 'month').month();
1026
+ var lastYear = moment(firstDay).subtract(1, 'month').year();
1027
+
1028
+ var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth();
1029
+
1030
+ var dayOfWeek = firstDay.day();
1031
+
1032
+ var i;
1033
+
1034
+ //initialize a 6 rows x 7 columns array for the calendar
1035
+ var calendar = [];
1036
+ calendar.firstDay = firstDay;
1037
+ calendar.lastDay = lastDay;
1038
+
1039
+ for (i = 0; i < 6; i++) {
1040
+ calendar[i] = [];
1041
+ }
1042
+
1043
+ //populate the calendar with date objects
1044
+ var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1;
1045
+ if (startDay > daysInLastMonth)
1046
+ startDay -= 7;
1047
+
1048
+ if (dayOfWeek == this.locale.firstDay)
1049
+ startDay = daysInLastMonth - 6;
1050
+
1051
+ // Possible patch for issue #626 https://github.com/dangrossman/bootstrap-daterangepicker/issues/626
1052
+ var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]); // .utcOffset(this.timeZone);
1053
+
1054
+ var col, row;
1055
+ for (i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) {
1056
+ if (i > 0 && col % 7 === 0) {
1057
+ col = 0;
1058
+ row++;
1059
+ }
1060
+ calendar[row][col] = curDate.clone().hour(hour);
1061
+ curDate.hour(12);
1062
+
1063
+ if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') {
1064
+ calendar[row][col] = this.minDate.clone();
1065
+ }
1066
+
1067
+ if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') {
1068
+ calendar[row][col] = this.maxDate.clone();
1069
+ }
1070
+
1071
+ }
1072
+
1073
+ return calendar;
1074
+ },
1075
+
1076
+ renderDropdowns: function (selected, minDate, maxDate) {
1077
+ var currentMonth = selected.month();
1078
+ var currentYear = selected.year();
1079
+ var maxYear = (maxDate && maxDate.year()) || (currentYear + 5);
1080
+ var minYear = (minDate && minDate.year()) || (currentYear - 50);
1081
+
1082
+ var monthHtml = '<select class="monthselect">';
1083
+ var inMinYear = currentYear == minYear;
1084
+ var inMaxYear = currentYear == maxYear;
1085
+
1086
+ for (var m = 0; m < 12; m++) {
1087
+ if ((!inMinYear || m >= minDate.month()) && (!inMaxYear || m <= maxDate.month())) {
1088
+ monthHtml += "<option value='" + m + "'" +
1089
+ (m === currentMonth ? " selected='selected'" : "") +
1090
+ ">" + this.locale.monthNames[m] + "</option>";
1091
+ }
1092
+ }
1093
+ monthHtml += "</select>";
1094
+
1095
+ var yearHtml = '<select class="yearselect">';
1096
+
1097
+ for (var y = minYear; y <= maxYear; y++) {
1098
+ yearHtml += '<option value="' + y + '"' +
1099
+ (y === currentYear ? ' selected="selected"' : '') +
1100
+ '>' + y + '</option>';
1101
+ }
1102
+
1103
+ yearHtml += '</select>';
1104
+
1105
+ return monthHtml + yearHtml;
1106
+ },
1107
+
1108
+ renderCalendar: function (calendar, selected, minDate, maxDate, side) {
1109
+
1110
+ var html = '<div class="calendar-date">';
1111
+ html += '<table class="table-condensed">';
1112
+ html += '<thead>';
1113
+ html += '<tr>';
1114
+
1115
+ // add empty cell for week number
1116
+ if (this.showWeekNumbers)
1117
+ html += '<th></th>';
1118
+
1119
+ if (!minDate || minDate.isBefore(calendar.firstDay)) {
1120
+ html += '<th class="prev available"><i class="fa fa-arrow-left icon icon-arrow-left glyphicon glyphicon-arrow-left"></i></th>';
1121
+ } else {
1122
+ html += '<th></th>';
1123
+ }
1124
+
1125
+ var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY");
1126
+
1127
+ if (this.showDropdowns) {
1128
+ dateHtml = this.renderDropdowns(calendar[1][1], minDate, maxDate);
1129
+ }
1130
+
1131
+ html += '<th colspan="5" class="month">' + dateHtml + '</th>';
1132
+ if (!maxDate || maxDate.isAfter(calendar.lastDay)) {
1133
+ html += '<th class="next available"><i class="fa fa-arrow-right icon icon-arrow-right glyphicon glyphicon-arrow-right"></i></th>';
1134
+ } else {
1135
+ html += '<th></th>';
1136
+ }
1137
+
1138
+ html += '</tr>';
1139
+ html += '<tr>';
1140
+
1141
+ // add week number label
1142
+ if (this.showWeekNumbers)
1143
+ html += '<th class="week">' + this.locale.weekLabel + '</th>';
1144
+
1145
+ $.each(this.locale.daysOfWeek, function (index, dayOfWeek) {
1146
+ html += '<th>' + dayOfWeek + '</th>';
1147
+ });
1148
+
1149
+ html += '</tr>';
1150
+ html += '</thead>';
1151
+ html += '<tbody>';
1152
+
1153
+ for (var row = 0; row < 6; row++) {
1154
+ html += '<tr>';
1155
+
1156
+ // add week number
1157
+ if (this.showWeekNumbers)
1158
+ html += '<td class="week">' + calendar[row][0].week() + '</td>';
1159
+
1160
+ for (var col = 0; col < 7; col++) {
1161
+ var cname = 'available ';
1162
+ cname += (calendar[row][col].month() == calendar[1][1].month()) ? '' : 'off';
1163
+
1164
+ if(calendar[row][col].isSame(new Date(), "day") ) {
1165
+ cname += ' today ';
1166
+ }
1167
+
1168
+ if ((minDate && calendar[row][col].isBefore(minDate, 'day')) || (maxDate && calendar[row][col].isAfter(maxDate, 'day'))) {
1169
+ cname = ' off disabled ';
1170
+ } else if (calendar[row][col].format('YYYY-MM-DD') == selected.format('YYYY-MM-DD')) {
1171
+ cname += ' active ';
1172
+ if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) {
1173
+ cname += ' start-date ';
1174
+ }
1175
+ if (calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) {
1176
+ cname += ' end-date ';
1177
+ }
1178
+ } else if (calendar[row][col] >= this.startDate && calendar[row][col] <= this.endDate) {
1179
+ cname += ' in-range ';
1180
+ if (calendar[row][col].isSame(this.startDate)) { cname += ' start-date '; }
1181
+ if (calendar[row][col].isSame(this.endDate)) { cname += ' end-date '; }
1182
+ }
1183
+
1184
+ var title = 'r' + row + 'c' + col;
1185
+ html += '<td class="' + cname.replace(/\s+/g, ' ').replace(/^\s?(.*?)\s?$/, '$1') + '" data-title="' + title + '">' + calendar[row][col].date() + '</td>';
1186
+ }
1187
+ html += '</tr>';
1188
+ }
1189
+
1190
+ html += '</tbody>';
1191
+ html += '</table>';
1192
+ html += '</div>';
1193
+
1194
+ var i;
1195
+ if (this.timePicker) {
1196
+
1197
+ html += '<div class="calendar-time">';
1198
+ html += '<select class="hourselect">';
1199
+
1200
+ // Disallow selections before the minDate or after the maxDate
1201
+ var min_hour = 0;
1202
+ var max_hour = 23;
1203
+
1204
+ if (minDate && (side == 'left' || this.singleDatePicker) && selected.format('YYYY-MM-DD') == minDate.format('YYYY-MM-DD')) {
1205
+ min_hour = minDate.hour();
1206
+ if (selected.hour() < min_hour)
1207
+ selected.hour(min_hour);
1208
+ if (this.timePicker12Hour && min_hour >= 12 && selected.hour() >= 12)
1209
+ min_hour -= 12;
1210
+ if (this.timePicker12Hour && min_hour == 12)
1211
+ min_hour = 1;
1212
+ }
1213
+
1214
+ if (maxDate && (side == 'right' || this.singleDatePicker) && selected.format('YYYY-MM-DD') == maxDate.format('YYYY-MM-DD')) {
1215
+ max_hour = maxDate.hour();
1216
+ if (selected.hour() > max_hour)
1217
+ selected.hour(max_hour);
1218
+ if (this.timePicker12Hour && max_hour >= 12 && selected.hour() >= 12)
1219
+ max_hour -= 12;
1220
+ }
1221
+
1222
+ var start = 0;
1223
+ var end = 23;
1224
+ var selected_hour = selected.hour();
1225
+ if (this.timePicker12Hour) {
1226
+ start = 1;
1227
+ end = 12;
1228
+ if (selected_hour >= 12)
1229
+ selected_hour -= 12;
1230
+ if (selected_hour === 0)
1231
+ selected_hour = 12;
1232
+ }
1233
+
1234
+ for (i = start; i <= end; i++) {
1235
+
1236
+ if (i == selected_hour) {
1237
+ html += '<option value="' + i + '" selected="selected">' + i + '</option>';
1238
+ } else if (i < min_hour || i > max_hour) {
1239
+ html += '<option value="' + i + '" disabled="disabled" class="disabled">' + i + '</option>';
1240
+ } else {
1241
+ html += '<option value="' + i + '">' + i + '</option>';
1242
+ }
1243
+ }
1244
+
1245
+ html += '</select> : ';
1246
+
1247
+ html += '<select class="minuteselect">';
1248
+
1249
+ // Disallow selections before the minDate or after the maxDate
1250
+ var min_minute = 0;
1251
+ var max_minute = 59;
1252
+
1253
+ if (minDate && (side == 'left' || this.singleDatePicker) && selected.format('YYYY-MM-DD h A') == minDate.format('YYYY-MM-DD h A')) {
1254
+ min_minute = minDate.minute();
1255
+ if (selected.minute() < min_minute)
1256
+ selected.minute(min_minute);
1257
+ }
1258
+
1259
+ if (maxDate && (side == 'right' || this.singleDatePicker) && selected.format('YYYY-MM-DD h A') == maxDate.format('YYYY-MM-DD h A')) {
1260
+ max_minute = maxDate.minute();
1261
+ if (selected.minute() > max_minute)
1262
+ selected.minute(max_minute);
1263
+ }
1264
+
1265
+ for (i = 0; i < 60; i += this.timePickerIncrement) {
1266
+ var num = i;
1267
+ if (num < 10)
1268
+ num = '0' + num;
1269
+ if (i == selected.minute()) {
1270
+ html += '<option value="' + i + '" selected="selected">' + num + '</option>';
1271
+ } else if (i < min_minute || i > max_minute) {
1272
+ html += '<option value="' + i + '" disabled="disabled" class="disabled">' + num + '</option>';
1273
+ } else {
1274
+ html += '<option value="' + i + '">' + num + '</option>';
1275
+ }
1276
+ }
1277
+
1278
+ html += '</select> ';
1279
+
1280
+ if (this.timePickerSeconds) {
1281
+ html += ': <select class="secondselect">';
1282
+
1283
+ for (i = 0; i < 60; i += this.timePickerIncrement) {
1284
+ var num = i;
1285
+ if (num < 10)
1286
+ num = '0' + num;
1287
+ if (i == selected.second()) {
1288
+ html += '<option value="' + i + '" selected="selected">' + num + '</option>';
1289
+ } else {
1290
+ html += '<option value="' + i + '">' + num + '</option>';
1291
+ }
1292
+ }
1293
+
1294
+ html += '</select>';
1295
+ }
1296
+
1297
+ if (this.timePicker12Hour) {
1298
+ html += '<select class="ampmselect">';
1299
+
1300
+ // Disallow selection before the minDate or after the maxDate
1301
+ var am_html = '';
1302
+ var pm_html = '';
1303
+
1304
+ if (minDate && (side == 'left' || this.singleDatePicker) && selected.format('YYYY-MM-DD') == minDate.format('YYYY-MM-DD') && minDate.hour() >= 12) {
1305
+ am_html = ' disabled="disabled" class="disabled"';
1306
+ }
1307
+
1308
+ if (maxDate && (side == 'right' || this.singleDatePicker) && selected.format('YYYY-MM-DD') == maxDate.format('YYYY-MM-DD') && maxDate.hour() < 12) {
1309
+ pm_html = ' disabled="disabled" class="disabled"';
1310
+ }
1311
+
1312
+ if (selected.hour() >= 12) {
1313
+ html += '<option value="AM"' + am_html + '>AM</option><option value="PM" selected="selected"' + pm_html + '>PM</option>';
1314
+ } else {
1315
+ html += '<option value="AM" selected="selected"' + am_html + '>AM</option><option value="PM"' + pm_html + '>PM</option>';
1316
+ }
1317
+ html += '</select>';
1318
+ }
1319
+
1320
+ html += '</div>';
1321
+
1322
+ }
1323
+
1324
+ return html;
1325
+
1326
+ },
1327
+
1328
+ remove: function() {
1329
+
1330
+ this.container.remove();
1331
+ this.element.off('.daterangepicker');
1332
+ this.element.removeData('daterangepicker');
1333
+
1334
+ }
1335
+
1336
+ };
1337
+
1338
+ $.fn.daterangepicker = function (options, cb) {
1339
+ this.each(function () {
1340
+ var el = $(this);
1341
+ if (el.data('daterangepicker'))
1342
+ el.data('daterangepicker').remove();
1343
+ el.data('daterangepicker', new DateRangePicker(el, options, cb));
1344
+ });
1345
+ return this;
1346
+ };
1347
+
1348
+ }));