Skip to content

Commit 1810c3d

Browse files
Documentation updates
1 parent 3bf1c76 commit 1810c3d

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ Use
1212
I recommend getting the eBook [Handling Time](https://sellfy.com/p/8gxZ) as it has a lot of example code to get started. The quick and dirty:
1313

1414
- To use this plugin you must include jQuery (1.6+) and jQuery UI with datepicker (and optionally slider).
15-
- Include timepicker-addon script located in the `dist` directory.
15+
- Include timepicker-addon script and css located in the `dist` directory or from a CDN:
16+
* [http://cdnjs.com/libraries/jquery-ui-timepicker-addon](http://cdnjs.com/libraries/jquery-ui-timepicker-addon)
17+
* [http://www.jsdelivr.com/#!jquery.ui.timepicker.addon](http://www.jsdelivr.com/#!jquery.ui.timepicker.addon)
1618
- now use timepicker with `$('#selector').datetimepicker()` or `$('#selector').timepicker()`.
1719

1820
There is also a [Bower](http://bower.io/) package named `jqueryui-timepicker-addon`. Beware there are other similar package names that point to forks which may not be current.

dist/index.html

+26-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ <h3>Download</h3>
112112
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
113113
.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
114114
</pre>
115+
116+
<p>If you prefer a hosted CDN there are a couple available: <a href="http://cdnjs.com/libraries/jquery-ui-timepicker-addon" title="Timepicker on CDNJS">CDNJS</a>, <a href="http://www.jsdelivr.com/#!jquery.ui.timepicker.addon" title="Timepicker on jsDelivr">jsDelivr</a>.</p>
115117
<br />
116118

117119
<h3>Requirements</h3>
@@ -459,7 +461,8 @@ <h2>Working with Localizations</h2>
459461
closeText: 'Закрыть'
460462
});
461463
</pre>
462-
<p>However, if you plan to use timepicker extensively you will need to include (build your own) localization. It is simply assigning those same variables to an object. As you see in the example below we maintain a separate object for timepicker. This way we aren't bound to any changes within datepicker.</p>
464+
<p>However, if you plan to use timepicker extensively you will need to include (build your own) localization. It is simply assigning those same variables to an object.</p>
465+
<p>As you see in the example below we maintain a separate object for timepicker. This way we aren't bound to any future changes within datepicker.</p>
463466

464467
<pre>$.datepicker.regional['ru'] = {
465468
closeText: 'Закрыть',
@@ -500,8 +503,14 @@ <h2>Working with Localizations</h2>
500503
};
501504
$.timepicker.setDefaults($.timepicker.regional['ru']);
502505
</pre>
506+
503507
<p>Now all you have to do is call timepicker and the Russian localization is used. Generally you only need to include the localization file, it will setDefaults() for you.</p>
504-
<p>You can also visit <a href="http://docs.jquery.com/UI/Datepicker/Localization" title="localization for datepicker" target="_BLANK">localization for datepicker</a> for more information about datepicker localizations.</p>
508+
<p>As of version 1.4.5 a combined file of all localizations available is included. This file DOES NOT call setDefaults(), so you will need to pass, or merge with your options.</p>
509+
510+
<pre>$('#example123').timepicker($.timepicker.regional['ru']);
511+
</pre>
512+
513+
<p>Localization files for datepicker are typically available in your jQueryUI downloads.</p>
505514
</div>
506515

507516
<!-- ############################################################################# -->
@@ -557,6 +566,20 @@ <h3 id="basic_examples">Basic Initializations</h3>
557566
</pre>
558567
</div>
559568

569+
570+
<!-- ============= example -->
571+
<div class="example-container">
572+
<p>Timepicker comes with a collection of localization files and one combined file with all available localizations. $.timepicker.regional["your localization code here"] is a simple object with preset options:</p>
573+
<div>
574+
<input type="text" name="basic_example_4" id="basic_example_4" value="" />
575+
</div>
576+
<pre>
577+
$('#basic_example_4').timepicker(
578+
$.timepicker.regional['es']
579+
);
580+
</pre>
581+
</div>
582+
560583
<h3 id="timezone_examples">Using Timezones</h3>
561584

562585
<!-- ============= example -->
@@ -954,6 +977,7 @@ <h3 id="utility_examples">Utilities</h3>
954977
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
955978
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
956979
<script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
980+
<script type="text/javascript" src="i18n/jquery-ui-timepicker-addon-i18n.min.js"></script>
957981
<script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
958982

959983
<script type="text/javascript">

src/docs/examples.html

+14
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ <h3 id="basic_examples">Basic Initializations</h3>
5151
</pre>
5252
</div>
5353

54+
55+
<!-- ============= example -->
56+
<div class="example-container">
57+
<p>Timepicker comes with a collection of localization files and one combined file with all available localizations. $.timepicker.regional["your localization code here"] is a simple object with preset options:</p>
58+
<div>
59+
<input type="text" name="basic_example_4" id="basic_example_4" value="" />
60+
</div>
61+
<pre>
62+
$('#basic_example_4').timepicker(
63+
$.timepicker.regional['es']
64+
);
65+
</pre>
66+
</div>
67+
5468
<h3 id="timezone_examples">Using Timezones</h3>
5569

5670
<!-- ============= example -->

src/docs/footer.html

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
88
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
99
<script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
10+
<script type="text/javascript" src="i18n/jquery-ui-timepicker-addon-i18n.min.js"></script>
1011
<script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
1112

1213
<script type="text/javascript">

src/docs/i18n.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ <h2>Working with Localizations</h2>
1919
closeText: 'Закрыть'
2020
});
2121
</pre>
22-
<p>However, if you plan to use timepicker extensively you will need to include (build your own) localization. It is simply assigning those same variables to an object. As you see in the example below we maintain a separate object for timepicker. This way we aren't bound to any changes within datepicker.</p>
22+
<p>However, if you plan to use timepicker extensively you will need to include (build your own) localization. It is simply assigning those same variables to an object.</p>
23+
<p>As you see in the example below we maintain a separate object for timepicker. This way we aren't bound to any future changes within datepicker.</p>
2324

2425
<pre>$.datepicker.regional['ru'] = {
2526
closeText: 'Закрыть',
@@ -60,6 +61,12 @@ <h2>Working with Localizations</h2>
6061
};
6162
$.timepicker.setDefaults($.timepicker.regional['ru']);
6263
</pre>
64+
6365
<p>Now all you have to do is call timepicker and the Russian localization is used. Generally you only need to include the localization file, it will setDefaults() for you.</p>
64-
<p>You can also visit <a href="http://docs.jquery.com/UI/Datepicker/Localization" title="localization for datepicker" target="_BLANK">localization for datepicker</a> for more information about datepicker localizations.</p>
66+
<p>As of version 1.4.5 a combined file of all localizations available is included. This file DOES NOT call setDefaults(), so you will need to pass, or merge with your options.</p>
67+
68+
<pre>$('#example123').timepicker($.timepicker.regional['ru']);
69+
</pre>
70+
71+
<p>Localization files for datepicker are typically available in your jQueryUI downloads.</p>
6572
</div>

src/docs/intro.html

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ <h3>Download</h3>
3737
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
3838
.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
3939
</pre>
40+
41+
<p>If you prefer a hosted CDN there are a couple available: <a href="http://cdnjs.com/libraries/jquery-ui-timepicker-addon" title="Timepicker on CDNJS">CDNJS</a>, <a href="http://www.jsdelivr.com/#!jquery.ui.timepicker.addon" title="Timepicker on jsDelivr">jsDelivr</a>.</p>
4042
<br />
4143

4244
<h3>Requirements</h3>

0 commit comments

Comments
 (0)