index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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 class="active">
  57. <a href="./">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="#minimal-requirements">Minimal Requirements</a></li>
  92. <li class="main "><a href="#installation-guides">Installation Guides</a></li>
  93. <li><a href="#bower">bower</a></li>
  94. <li><a href="#nuget">Nuget</a></li>
  95. <li><a href="#rails">Rails</a></li>
  96. <li><a href="#angular-wrapper">Angular Wrapper</a></li>
  97. <li><a href="#meteorjs">Meteor.js</a></li>
  98. <li><a href="#manual">Manual</a></li>
  99. <li><a href="#knockout">Knockout</a></li>
  100. </ul>
  101. </div></div>
  102. <div class="col-md-8" role="main">
  103. <div class="alert alert-danger" style="font-size:1.5em;">
  104. <strong>Important!</strong>
  105. Please read this <a href="https://eonasdan.com/posts/state-of-my-picker" target="_blank">blog post</a>
  106. </div>
  107. <h1 id="minimal-requirements">Minimal Requirements</h1>
  108. <ol>
  109. <li>jQuery</li>
  110. <li>Moment.js</li>
  111. <li>Bootstrap.js (transition and collapse are required if you're not using the full Bootstrap)</li>
  112. <li>Bootstrap Datepicker script</li>
  113. <li>Bootstrap CSS</li>
  114. <li>Bootstrap Datepicker CSS</li>
  115. <li>Locales: Moment's locale files are <a href="https://github.com/moment/moment/tree/master/locale">here</a></li>
  116. </ol>
  117. <h1 id="installation-guides">Installation Guides</h1>
  118. <ul>
  119. <li><a href="#bower-">Bower</a></li>
  120. <li><a href="#nuget">Nuget</a></li>
  121. <li><a href="#rails-">Rails</a></li>
  122. <li><a href="#angular-wrapper">Angular</a></li>
  123. <li><a href="#meteorjs">Meteor.js</a></li>
  124. <li><a href="#manual">Manual</a></li>
  125. </ul>
  126. <h2 id="bower"><a href="http://bower.io">bower</a> <img alt="Bower version" src="https://badge.fury.io/bo/eonasdan-bootstrap-datetimepicker.png" /></h2>
  127. <p>Run the following command:</p>
  128. <pre><code>bower install eonasdan-bootstrap-datetimepicker#latest --save
  129. </code></pre>
  130. <p>Include necessary scripts and styles:</p>
  131. <pre><code class="html">&lt;head&gt;
  132. &lt;!-- ... --&gt;
  133. &lt;script type=&quot;text/javascript&quot; src=&quot;/bower_components/jquery/jquery.min.js&quot;&gt;&lt;/script&gt;
  134. &lt;script type=&quot;text/javascript&quot; src=&quot;/bower_components/moment/min/moment.min.js&quot;&gt;&lt;/script&gt;
  135. &lt;script type=&quot;text/javascript&quot; src=&quot;/bower_components/bootstrap/dist/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;
  136. &lt;script type=&quot;text/javascript&quot; src=&quot;/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js&quot;&gt;&lt;/script&gt;
  137. &lt;link rel=&quot;stylesheet&quot; href=&quot;/bower_components/bootstrap/dist/css/bootstrap.min.css&quot; /&gt;
  138. &lt;link rel=&quot;stylesheet&quot; href=&quot;/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css&quot; /&gt;
  139. &lt;/head&gt;
  140. </code></pre>
  141. <h2 id="nuget">Nuget</h2>
  142. <h3 id="less"><a href="https://www.nuget.org/packages/Bootstrap.v3.Datetimepicker/">LESS</a>: <img alt="NuGet version" src="https://badge.fury.io/nu/Bootstrap.v3.Datetimepicker.png" /></h3>
  143. <pre><code>PM&gt; Install-Package Bootstrap.v3.Datetimepicker
  144. </code></pre>
  145. <h3 id="css"><a href="https://www.nuget.org/packages/Bootstrap.v3.Datetimepicker.CSS/">CSS</a>: <img alt="NuGet version" src="https://badge.fury.io/nu/Bootstrap.v3.Datetimepicker.CSS.png" /></h3>
  146. <pre><code>PM&gt; Install-Package Bootstrap.v3.Datetimepicker.CSS
  147. </code></pre>
  148. <pre><code class="html">&lt;head&gt;
  149. &lt;script type=&quot;text/javascript&quot; src=&quot;/scripts/jquery.min.js&quot;&gt;&lt;/script&gt;
  150. &lt;script type=&quot;text/javascript&quot; src=&quot;/scripts/moment.min.js&quot;&gt;&lt;/script&gt;
  151. &lt;script type=&quot;text/javascript&quot; src=&quot;/scripts/bootstrap.min.js&quot;&gt;&lt;/script&gt;
  152. &lt;script type=&quot;text/javascript&quot; src=&quot;/scripts/bootstrap-datetimepicker.*js&quot;&gt;&lt;/script&gt;
  153. &lt;!-- include your less or built css files --&gt;
  154. &lt;!--
  155. bootstrap-datetimepicker-build.less will pull in &quot;../bootstrap/variables.less&quot; and &quot;bootstrap-datetimepicker.less&quot;;
  156. or
  157. &lt;link rel=&quot;stylesheet&quot; href=&quot;/Content/bootstrap-datetimepicker.css&quot; /&gt;
  158. --&gt;
  159. &lt;/head&gt;
  160. </code></pre>
  161. <h2 id="rails"><a href="http://rubygems.org/gems/bootstrap3-datetimepicker-rails">Rails</a> <img alt="Gem Version" src="https://badge.fury.io/rb/bootstrap3-datetimepicker-rails.png" /></h2>
  162. <p>Add the following to your <code>Gemfile</code>:</p>
  163. <pre><code class="ruby">gem 'momentjs-rails', '&gt;= 2.9.0'
  164. gem 'bootstrap3-datetimepicker-rails', '~&gt; 4.14.30'
  165. </code></pre>
  166. <p>Note: You may need to change the version number above to the version number on the badge above.
  167. Read the rest of the install instructions @
  168. <a href="https://github.com/TrevorS/bootstrap3-datetimepicker-rails">TrevorS/bootstrap3-datetimepicker-rails</a></p>
  169. <h2 id="angular-wrapper">Angular Wrapper</h2>
  170. <p>Follow the link <a href="https://gist.github.com/eugenekgn/f00c4d764430642dca4b">here</a></p>
  171. <h2 id="meteorjs">Meteor.js</h2>
  172. <p>This widget has been package for the <a href="http://www.meteor.com/">Meteor.js</a> platform, to install it use meteorite as follows:</p>
  173. <p><code>$ mrt add tsega:bootstrap3-datetimepicker</code></p>
  174. <p>For more detail see the package page on <a href="http://atmospherejs.com/package/bootstrap3-datetimepicker">Atmosphere</a></p>
  175. <h2 id="manual">Manual</h2>
  176. <h3 id="acquire-jquery">Acquire <a href="http://jquery.com">jQuery</a></h3>
  177. <h3 id="acquire-momentjs">Acquire <a href="https://github.com/moment/moment">Moment.js</a></h3>
  178. <h3 id="bootstrap-3-collapse-and-transition-plugins">Bootstrap 3 collapse and transition plugins</h3>
  179. <p>Make sure to include *.JS files for plugins <a href="http://getbootstrap.com/javascript/#collapse">collapse</a> and <a href="http://getbootstrap.com/javascript/#transitions">transitions</a>. They are included with <a href="https://github.com/twbs/bootstrap/tree/master/js">bootstrap in js/ directory</a>
  180. Alternatively you could include the whole bundle of bootstrap plugins from <a href="https://github.com/twbs/bootstrap/tree/master/dist/js">bootstrap.js</a></p>
  181. <pre><code class="html">&lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/jquery.js&quot;&gt;&lt;/script&gt;
  182. &lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/moment.js&quot;&gt;&lt;/script&gt;
  183. &lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/bootstrap/js/transition.js&quot;&gt;&lt;/script&gt;
  184. &lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/bootstrap/js/collapse.js&quot;&gt;&lt;/script&gt;
  185. &lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/bootstrap/dist/bootstrap.min.js&quot;&gt;&lt;/script&gt;
  186. &lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/bootstrap-datetimepicker.min.js&quot;&gt;&lt;/script&gt;
  187. </code></pre>
  188. <h2 id="knockout">Knockout</h2>
  189. <pre><code>ko.bindingHandlers.dateTimePicker = {
  190. init: function (element, valueAccessor, allBindingsAccessor) {
  191. //initialize datepicker with some optional options
  192. var options = allBindingsAccessor().dateTimePickerOptions || {};
  193. $(element).datetimepicker(options);
  194. //when a user changes the date, update the view model
  195. ko.utils.registerEventHandler(element, &quot;dp.change&quot;, function (event) {
  196. var value = valueAccessor();
  197. if (ko.isObservable(value)) {
  198. if (event.date != null &amp;&amp; !(event.date instanceof Date)) {
  199. value(event.date.toDate());
  200. } else {
  201. value(event.date);
  202. }
  203. }
  204. });
  205. ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
  206. var picker = $(element).data(&quot;DateTimePicker&quot;);
  207. if (picker) {
  208. picker.destroy();
  209. }
  210. });
  211. },
  212. update: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
  213. var picker = $(element).data(&quot;DateTimePicker&quot;);
  214. //when the view model is updated, update the widget
  215. if (picker) {
  216. var koDate = ko.utils.unwrapObservable(valueAccessor());
  217. //in case return from server datetime i am get in this form for example /Date(93989393)/ then fomat this
  218. koDate = (typeof (koDate) !== 'object') ? new Date(parseFloat(koDate.replace(/[^0-9]/g, ''))) : koDate;
  219. picker.date(koDate);
  220. }
  221. }
  222. };
  223. </code></pre>
  224. <h3 id="css-styles">CSS styles</h3>
  225. <h4 id="using-less">Using LESS</h4>
  226. <pre><code class="css">@import &quot;/path/to/bootstrap/less/variables&quot;;
  227. @import &quot;/path/to/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less&quot;;
  228. // [...] your custom styles and variables
  229. </code></pre>
  230. <p>Using CSS (default color palette)</p>
  231. <pre><code class="html">&lt;link rel=&quot;stylesheet&quot; href=&quot;/path/to/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css&quot; /&gt;
  232. </code></pre>
  233. </div>
  234. </div>
  235. </div>
  236. <script src="../js/prettify-1.0.min.js"></script>
  237. <script src="../js/base.js"></script>
  238. <script>
  239. if (top != self) {
  240. top.location.replace(self.location.href);
  241. }
  242. (function (i, s, o, g, r, a, m) {
  243. i['GoogleAnalyticsObject'] = r;
  244. i[r] = i[r] || function () {
  245. (i[r].q = i[r].q || []).push(arguments)
  246. }, i[r].l = 1 * new Date();
  247. a = s.createElement(o),
  248. m = s.getElementsByTagName(o)[0];
  249. a.async = 1;
  250. a.src = g;
  251. m.parentNode.insertBefore(a, m)
  252. })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
  253. ga('create', 'UA-47462200-1', 'eonasdan.github.io');
  254. ga('send', 'pageview');
  255. </script>
  256. </body>
  257. </html>