index.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
  8. <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
  9. <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
  10. <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
  11. <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
  12. <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
  13. <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
  14. <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
  15. <link rel="icon" type="image/png" href="/favicon-196x196.png" sizes="196x196">
  16. <link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
  17. <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
  18. <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
  19. <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
  20. <meta name="msapplication-TileColor" content="#2b5797">
  21. <meta name="msapplication-TileImage" content="/mstile-144x144.png">
  22. <title></title>
  23. <link rel="stylesheet" type="text/css" media="screen"
  24. href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
  25. <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
  26. <link href="../css/prettify-1.0.css" rel="stylesheet">
  27. <link href="../css/base.css" rel="stylesheet">
  28. <link href="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
  29. <script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>
  30. <script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
  31. <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
  32. <script src="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js"></script>
  33. </head>
  34. <body>
  35. <div class="navbar navbar-default navbar-fixed-top" role="navigation">
  36. <div class="container">
  37. <!-- Collapsed navigation -->
  38. <div class="navbar-header">
  39. <!-- Expander button -->
  40. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  41. <span class="sr-only">Toggle navigation</span>
  42. <span class="icon-bar"></span>
  43. <span class="icon-bar"></span>
  44. <span class="icon-bar"></span>
  45. </button>
  46. <!-- Main title -->
  47. <a class="navbar-brand" href=""></a>
  48. </div>
  49. <!-- Expanded navigation -->
  50. <div class="navbar-collapse collapse">
  51. <!-- Main navigation -->
  52. <ul class="nav navbar-nav">
  53. <li >
  54. <a href="..">Usage</a>
  55. </li>
  56. <li >
  57. <a href="../Installing/">Installing</a>
  58. </li>
  59. <li >
  60. <a href="../Functions/">Functions</a>
  61. </li>
  62. <li >
  63. <a href="../Options/">Options</a>
  64. </li>
  65. <li >
  66. <a href="../Events/">Events</a>
  67. </li>
  68. <li >
  69. <a href="../Changelog.md">Change Log</a>
  70. </li>
  71. <li >
  72. <a href="../ContributorsGuide/">Dev Guide</a>
  73. </li>
  74. <li >
  75. <a href="../Extras/">Extras</a>
  76. </li>
  77. <li >
  78. <a href="../FAQ/">FAQs</a>
  79. </li>
  80. </ul>
  81. <!-- Search, Navigation and Repo links -->
  82. <ul class="nav navbar-nav navbar-right">
  83. </ul>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="container">
  88. <div class="row">
  89. <div class="col-md-3"><script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CK7DC5QN&placement=eonasdangithubio" id="_carbonads_js"></script>
  90. <div class="bs-sidebar hidden-print affix well" role="complementary"> <ul class="nav bs-sidenav">
  91. <li class="main active"><a href="#version-4">Version 4</a></li>
  92. <li><a href="#41742">4.17.42</a></li>
  93. <li><a href="#41737">4.17.37</a></li>
  94. <li><a href="#41535">4.15.35</a></li>
  95. <li><a href="#41430">4.14.30</a></li>
  96. <li><a href="#4714">4.7.14</a></li>
  97. <li><a href="#400">4.0.0</a></li>
  98. <li class="main "><a href="#version-3">Version 3</a></li>
  99. <li><a href="#300">3.0.0</a></li>
  100. <li class="main "><a href="#version-2">Version 2</a></li>
  101. <li><a href="#2132-hotfix">2.1.32 (Hotfix)</a></li>
  102. <li><a href="#2130">2.1.30</a></li>
  103. <li><a href="#2120">2.1.20</a></li>
  104. <li><a href="#2111">2.1.11</a></li>
  105. <li><a href="#215">2.1.5</a></li>
  106. <li><a href="#201">2.0.1</a></li>
  107. <li><a href="#200">2.0.0</a></li>
  108. </ul>
  109. </div></div>
  110. <div class="col-md-8" role="main">
  111. <div class="alert alert-danger" style="font-size:1.5em;">
  112. <strong>Important!</strong>
  113. Please read this <a href="https://eonasdan.com/state-of-my-picker" target="_blank">blog post</a>
  114. </div>
  115. <h1 id="version-4">Version 4</h1>
  116. <h2 id="41742">4.17.42</h2>
  117. <h3 id="bug-squashing">Bug Squashing</h3>
  118. <ul>
  119. <li>fixed moment dependencies to all be the same</li>
  120. <li>defaulted <code>option.timeZone</code> to <code>''</code> instead of UTC. This way it will default to the local timezone if it's not set.</li>
  121. <li>fixed #959</li>
  122. <li>fixed #1311 internal <code>getMoment</code> function no longer sets <code>startOf('d')</code></li>
  123. <li>fixed #935</li>
  124. </ul>
  125. <h3 id="other">Other</h3>
  126. <ul>
  127. <li>moved some (will move the rest soon) inline docs to JSDoc now that ReSharper supports it.</li>
  128. <li>moved getter/setter functions to options page instead. #1313</li>
  129. </ul>
  130. <h2 id="41737">4.17.37</h2>
  131. <h3 id="new-features">New Features</h3>
  132. <ul>
  133. <li>Momentjs TZ intergration #1242 thanks @bodrick</li>
  134. <li>Independent CSS file, in case you don't want bootstrap for some reason</li>
  135. </ul>
  136. <h3 id="bug-squashing_1">Bug Squashing</h3>
  137. <ul>
  138. <li>Slight changes decade view</li>
  139. <li>Moved all tooltip text to <code>tooltips</code></li>
  140. <li>fixed #1212</li>
  141. </ul>
  142. <h2 id="41535">4.15.35</h2>
  143. <h3 id="new-features_1">New Features</h3>
  144. <p><code>tooltips</code> allows custom, localized text to be included for icon tooltips</p>
  145. <h3 id="bug-squashing_2">Bug Squashing</h3>
  146. <p>fixed #1066</p>
  147. <p>fixed #1087 <code>sideBySide</code> properly supports <code>toolbarPlacement [top, bottom]</code></p>
  148. <p>fixed #1119 </p>
  149. <p>fixed #1069 added input.blur()</p>
  150. <p>fixed #1049 fixed doc example </p>
  151. <p>fixed #999 picker now looks for an element with <code>.input-group-addon</code></p>
  152. <h2 id="41430">4.14.30</h2>
  153. <h3 id="new-features_2">New Features</h3>
  154. <p><code>disabledTimeIntervals</code> #644</p>
  155. <p><code>allowInputToggle</code> #929</p>
  156. <p><code>focusOnShow</code> #884</p>
  157. <p>public <code>viewDate</code> function #872</p>
  158. <p><code>enabledHours</code> and <code>disabledHours</code>.</p>
  159. <p><code>dp.update</code> fires when <code>viewDate</code> is changed (in most cases) #937</p>
  160. <p><code>viewMode</code> now supports a decades view. </p>
  161. <p><strong>Note</strong>: because the year picker shows 12 years at a time, I've elected to make this view show blocks of 12 years</p>
  162. <p><strong>Note</strong>: when selecting a decade the <code>viewDate</code> will change to the <strong>center</strong> of the selected years</p>
  163. <p><code>parseInputDate</code> #1095</p>
  164. <h3 id="bug-squashing_3">Bug Squashing</h3>
  165. <p>fixed #815 by adding <code>.wider</code> when using both seconds and am/pm.</p>
  166. <p>fixed #816 changed both min/max date to move the selected date inside.</p>
  167. <p>fixed #855 #881 <code>fillDate</code>, <code>fillMonths</code>, <code>fillDow</code> uses <code>startOf('day')</code>, which will hopefully fix the DST issues.</p>
  168. <p>fixed #885 <code>daysOfWeekDisabled</code> will move the date to a valid date if <code>useCurrent</code> is <code>true</code>. Today button will check if the DoW is disabled.</p>
  169. <p>fixed #906</p>
  170. <p>fixed #912 if <code>useCurrent:false</code> month and year view will no longer have the current month/year selected.</p>
  171. <p>fixed #914 <code>use24hours</code> will ignore anything in side of <code>[]</code> in the format string.</p>
  172. <p>fixed #916 added titles to all icons. At some point the text should be moved to the icon's array, but this would probably be a breaking change.</p>
  173. <p>fixed #940 added -1 tab index to am/pm selector</p>
  174. <h3 id="other-changes">Other Changes</h3>
  175. <p>changed in/decrement behavior to check if the new date is valid at that granularity (hours, minutes, seconds). will also validate as before</p>
  176. <h2 id="4714">4.7.14</h2>
  177. <p>Added several in new features:</p>
  178. <pre><code>`keybinds`, `inline`, `debug`, `clear()`, `showClose`, `ingoreReadOnly`, `datepickerInput` and `keepInvalid`.
  179. </code></pre>
  180. <p>Bug squashing</p>
  181. <h2 id="400">4.0.0</h2>
  182. <h4 id="changes-for-using-the-component">Changes for using the component</h4>
  183. <ul>
  184. <li>
  185. <p>Defined a <a href="https://github.com/Eonasdan/bootstrap-datetimepicker/wiki/Version-4-Public-API">Public API</a> and hidden rest of functions, variables so that all configuration options can be changed dynamically.</p>
  186. </li>
  187. <li>
  188. <p><code>set/getDate()</code> is now replaced with an overloaded <code>date()</code> function. Use it without a parameter to get the currently set date or with a parameter to set the date.</p>
  189. </li>
  190. <li>
  191. <p><code>hide()</code>, <code>show()</code>, <code>toggle()</code>, <code>enable()</code>, <code>disable()</code> and the rest of setter functions now support chaining. ie <code>$('#id').data('DateTimePicker').format('DD-MM-YYYY').minDate(moment()).defaultDate(moment()).show()</code> works</p>
  192. </li>
  193. <li>
  194. <p>Replaced previous - next buttons in Date subviews with configurable icons</p>
  195. </li>
  196. <li>
  197. <p>Changed <code>language</code> option name to <code>locale</code> to be inline with moment naming</p>
  198. </li>
  199. <li>
  200. <p>Implemented #402 all data-date-* variables are more readable and also match with the ones in the configuration object</p>
  201. </li>
  202. <li>
  203. <p><code>options.direction</code> and <code>options.orientation</code> were merged into a single object <code>options.widgetPositioning</code> with <code>vertical</code> and <code>horizontal</code> keys that take a string value of <code>'auto', 'top', 'bottom'</code> and <code>'auto', 'left', 'right'</code> respectively. Note that the <code>'up'</code> option was renamed to <code>'top'</code></p>
  204. </li>
  205. </ul>
  206. <h4 id="added-functionality">Added functionality</h4>
  207. <ul>
  208. <li>
  209. <p>added a second way to define options as data attributes. Instead of adding distinct <code>data-date-*</code> config options you can now also pass a <code>data-date-options</code> attribute containing an object just the same as the options object that <code>element.datetimepicker</code> constructor call takes</p>
  210. </li>
  211. <li>
  212. <p>also added a <code>options()</code> public api function to get/set that takes an option object and applies it to the component in one call</p>
  213. </li>
  214. <li>
  215. <p>Implemented <a href="https://github.com/Eonasdan/bootstrap-datetimepicker/issues/130">#130</a> by introducing a boolean <code>options.calendarWeeks</code> and <code>calendarWeeks()</code> api function</p>
  216. </li>
  217. <li>
  218. <p>Implemented <a href="https://github.com/Eonasdan/bootstrap-datetimepicker/issues/328">#328</a>, <a href="https://github.com/Eonasdan/bootstrap-datetimepicker/issues/426">#426</a></p>
  219. </li>
  220. <li>
  221. <p>Implemented <a href="https://github.com/Eonasdan/bootstrap-datetimepicker/issues/432">#432</a>. Widget DOM element is now lazily added only when shown and removed from the document when hidden.</p>
  222. </li>
  223. <li>
  224. <p>Implemented <a href="https://github.com/Eonasdan/bootstrap-datetimepicker/issues/141">#141</a> and <a href="https://github.com/Eonasdan/bootstrap-datetimepicker/issues/283">#283</a></p>
  225. </li>
  226. </ul>
  227. <h4 id="contributors-related-internal-code-changes">Contributors related internal code changes</h4>
  228. <ul>
  229. <li>
  230. <p>Refactor all UI click functions and put them as functions in the actions array private variable</p>
  231. </li>
  232. <li>
  233. <p>Refactor template building process to seperate functions according to what they do</p>
  234. </li>
  235. <li>
  236. <p>Remove some styles that where hardcoded in the javascript code</p>
  237. </li>
  238. <li>
  239. <p>Refactor all code that changes the picker.date to change it through the setValue function to allow one place for validation logic (min/max/weekdaysenabled etc) and also one place for emmiting dp.change events</p>
  240. </li>
  241. <li>
  242. <p>The v4beta branch code includes all fixes up to v.3.1.2</p>
  243. </li>
  244. <li>
  245. <p>Added <code>toggle()</code> to the public API which toggles the visibility of the DateTimePicker</p>
  246. </li>
  247. <li>
  248. <p>Refactored set function to be included in the setValue function</p>
  249. </li>
  250. <li>
  251. <p>Added a testing framework using jasmine and phantom.js</p>
  252. </li>
  253. </ul>
  254. <h1 id="version-3">Version 3</h1>
  255. <h2 id="300">3.0.0</h2>
  256. <ul>
  257. <li>Fix for #170, #179, #183: Changed event to <code>dp.-</code>. This should fix the double change event firing.</li>
  258. <li>Fix for #192: <code>setDate</code> now fires <code>dp.change</code></li>
  259. <li>Fix for #182: Picker will <strong>not</strong> set the default date if the input field has a value</li>
  260. <li>Fix for #169: Seconds doesn't get reset when changing the date (Thanks to PR #174)</li>
  261. <li>Fix for #168 z-index fix for BS modal</li>
  262. <li>Fix for #155 Picker properly displays the active year and month</li>
  263. <li>Fix for #154 CSS update to fix the collapse jump</li>
  264. <li>Fix for #150 and #75 <code>minViewMode</code> and <code>viewMode</code> work properly</li>
  265. <li>Fix for #147 AM/PM won't toggle when selecting a value from the hours grid</li>
  266. <li>Fix for #44 Finally! It's here!! Thanks to @ruiwei and his code on #210 picker will adjust the positioning of the widget.</li>
  267. </ul>
  268. <h4 id="manually-merged-pr">Manually merged PR</h4>
  269. <ul>
  270. <li>PR #178 When using <code>minuteStepping</code> the minute select grid will only show available steppings</li>
  271. <li>PR #195, #197 Using the <code>data-OPTION</code> has been changed to <code>data-date-OPTION</code>. These options are expected to be on the <code>input-group</code> if you're using the <code>input-group</code> <strong>or</strong> the a bare input field if you're not using the <code>input-group</code></li>
  272. <li>PR #184 The option <code>sideBySide</code> change be used to display both the d and the timepicker side by side</li>
  273. <li>PR #143 Added option <code>daysOfWeekDisabled: []</code>. For example, use <code>daysOfWeekDisabled: [0,6]</code> to disable Sunday and Saturday</li>
  274. </ul>
  275. <h4 id="other-changes_1"><strong>Other Changes</strong></h4>
  276. <ul>
  277. <li>Changed picker width to 300px if using seconds and am/pm</li>
  278. <li>Added option <code>useCurrent</code>, thanks to @ruiwei. When true, picker will set the value to the current date/time (respects picker's format)</li>
  279. <li>Added option <code>showToday</code>, thanks to @ruiwei. When true, picker will display a small arrow to indicate today's date.</li>
  280. <li>Changed <code>startDate</code> to <code>minDate</code> and <code>endDate</code> to <code>maxDate</code> to make it more clear what these options do.</li>
  281. </ul>
  282. <h1 id="version-2">Version 2</h1>
  283. <h4 id="2132-hotfix">2.1.32 (Hotfix)</h4>
  284. <ul>
  285. <li>Fix for #151: When a bad date value or the picker is cleared, the plugin will not longer attempt to reset it back to the previous date</li>
  286. <li>Fix for #140: <code>setDate</code> can be given <code>null</code> to force clear the picker</li>
  287. </ul>
  288. <h4 id="2130">2.1.30</h4>
  289. <h5 id="important-buildless-file-name-has-been-been-changed-to-bootstrap-datetimepicker-buildless-to-prevent-collisions">Important! <code>build.less</code> file name has been been changed to <code>bootstrap-datetimepicker-build.less</code> to prevent collisions</h5>
  290. <ul>
  291. <li>Fix for #135: <code>setStartDate</code> and <code>setEndDate</code> should now properly set.</li>
  292. <li>Fix for #133: Typed in date now respects en/disabled dates</li>
  293. <li>Fix for #132: En/disable picker function works again</li>
  294. <li>Fix for #117, #119, #128, #121: double event <code>change</code> event issues should be fixed</li>
  295. <li>
  296. <p>Fix for #112: <code>change</code> function no longer sets the input to a blank value if the passed in date is invalid</p>
  297. </li>
  298. <li>
  299. <p>Enhancement for #103: Increated the <code>z-index</code> of the widget</p>
  300. </li>
  301. </ul>
  302. <h4 id="2120">2.1.20</h4>
  303. <ul>
  304. <li>Fix for #83: Changes to the picker should fire native <code>change</code> event for knockout and the like as well as <code>change.dp</code> which contains the old date and the new date</li>
  305. <li>Fix for #78: Script has been update for breaking changes in Moment 2.4.0</li>
  306. <li>
  307. <p>Fix for #73: IE8 should be working now</p>
  308. </li>
  309. <li>
  310. <p>Enhancement for #79: <code>minuteStepping</code> option takes a number (default is 1). Changing the minutes in the time picker will step by this number.</p>
  311. </li>
  312. <li>Enhancement for #74 and #65: <code>useMinutes</code> and <code>useSeconds</code> are now options. Disabling seconds will hide the seconds spinner. Disabling minutes will display <code>00</code> and hide the arrows</li>
  313. <li>Enhancement for #67: Picker will now attempt to convert all <code>data-OPTION</code> into its appropriate option</li>
  314. </ul>
  315. <h4 id="2111">2.1.11</h4>
  316. <ul>
  317. <li>Fix for #51, #60</li>
  318. <li>Fix for #52: Picker has its own <code>moment</code> object since moment 2.4.0 has removed global reference</li>
  319. <li>Fix for #57: New option for <code>useStrict</code>. When validating dates in <code>update</code> and <code>change</code>, the picker can use a stricter formatting validation</li>
  320. <li>Fix for #61: Picker should now properly take formatted date. Should also have correct start of the week for locales.</li>
  321. <li>Fix for #62: Default format will properly validate time picker only.</li>
  322. </ul>
  323. <h4 id="215">2.1.5</h4>
  324. <ul>
  325. <li>Custom icons, such as Font Awesome, are now supported. (#49)</li>
  326. <li>If more then one <code>input-group-addon</code> is present use <code>datepickerbutton</code> to identify where the picker should popup from. (#48)</li>
  327. <li>New Event: <code>error.dp</code>. Fires when Moment cannot parse the date or when the timepicker cannot change because of a <code>disabledDates</code> setting. Returns a Moment date object. The specific error can be found be using <code>invalidAt()</code>. For more information see <a href="http://momentjs.com/docs/#/parsing/is-valid/">Moment's docs</a></li>
  328. <li>Fix for #42, plugin will now check for <code>A</code> or <code>a</code> in the format string to determine if the AM/PM selector should display.</li>
  329. <li>Fix for #45, fixed null/empty and invalid dates</li>
  330. <li>Fix for #46, fixed active date highlighting</li>
  331. <li>Fix for #47, <code>change.dp</code> event to also include the previous date.</li>
  332. </ul>
  333. <h4 id="201">2.0.1</h4>
  334. <ul>
  335. <li>New event <code>error.dp</code> fires when plugin cannot parse date or when increase/descreasing hours/minutes to a disabled date.</li>
  336. <li>Minor fixes</li>
  337. </ul>
  338. <h4 id="200">2.0.0</h4>
  339. <ul>
  340. <li><code>disabledDates</code> is now an option to set the disabled dates. It accepts date objects like <code>new Date("November 12, 2013 00:00:00")</code> and <code>12/25/2013' and</code>moment` date objects</li>
  341. <li>Events are easier to use</li>
  342. </ul>
  343. </div>
  344. </div>
  345. </div>
  346. <script src="../js/prettify-1.0.min.js"></script>
  347. <script src="../js/base.js"></script>
  348. <script>
  349. if (top != self) {
  350. top.location.replace(self.location.href);
  351. }
  352. (function (i, s, o, g, r, a, m) {
  353. i['GoogleAnalyticsObject'] = r;
  354. i[r] = i[r] || function () {
  355. (i[r].q = i[r].q || []).push(arguments)
  356. }, i[r].l = 1 * new Date();
  357. a = s.createElement(o),
  358. m = s.getElementsByTagName(o)[0];
  359. a.async = 1;
  360. a.src = g;
  361. m.parentNode.insertBefore(a, m)
  362. })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
  363. ga('create', 'UA-47462200-1', 'eonasdan.github.io');
  364. ga('send', 'pageview');
  365. </script>
  366. </body>
  367. </html>