multi-dates-picker-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +41 -0
  5. data/Rakefile +1 -0
  6. data/app/assets/images/ui-bg_diagonal-maze_20_6e4f1c_10x10.png +0 -0
  7. data/app/assets/images/ui-bg_diagonal-maze_40_000000_10x10.png +0 -0
  8. data/app/assets/images/ui-bg_fine-grain_10_eceadf_60x60.png +0 -0
  9. data/app/assets/images/ui-bg_fine-grain_10_f8f7f6_60x60.png +0 -0
  10. data/app/assets/images/ui-bg_fine-grain_15_d3c05a_60x60.png +0 -0
  11. data/app/assets/images/ui-bg_fine-grain_15_eceadf_60x60.png +0 -0
  12. data/app/assets/images/ui-bg_fine-grain_15_ffffff_60x60.png +0 -0
  13. data/app/assets/images/ui-bg_fine-grain_65_654b24_60x60.png +0 -0
  14. data/app/assets/images/ui-bg_fine-grain_68_b83400_60x60.png +0 -0
  15. data/app/assets/images/ui-icons_222222_256x240.png +0 -0
  16. data/app/assets/images/ui-icons_3572ac_256x240.png +0 -0
  17. data/app/assets/images/ui-icons_8c291d_256x240.png +0 -0
  18. data/app/assets/images/ui-icons_b83400_256x240.png +0 -0
  19. data/app/assets/images/ui-icons_fbdb93_256x240.png +0 -0
  20. data/app/assets/images/ui-icons_ffffff_256x240.png +0 -0
  21. data/app/assets/javascripts/jquery-ui.multidatespicker.js +457 -0
  22. data/app/assets/stylesheets/mdp.css +126 -0
  23. data/app/assets/stylesheets/pepper-ginder-custom.css +572 -0
  24. data/app/assets/stylesheets/prettify.css +1 -0
  25. data/lib/multi-dates-picker-rails.rb +6 -0
  26. data/lib/multi-dates-picker-rails/version.rb +9 -0
  27. data/multi-dates-picker-rails.gemspec +19 -0
  28. data/vendor/multiple-dates-picker/README.md +48 -0
  29. data/vendor/multiple-dates-picker/css/images/ui-bg_diagonal-maze_20_6e4f1c_10x10.png +0 -0
  30. data/vendor/multiple-dates-picker/css/images/ui-bg_diagonal-maze_40_000000_10x10.png +0 -0
  31. data/vendor/multiple-dates-picker/css/images/ui-bg_fine-grain_10_eceadf_60x60.png +0 -0
  32. data/vendor/multiple-dates-picker/css/images/ui-bg_fine-grain_10_f8f7f6_60x60.png +0 -0
  33. data/vendor/multiple-dates-picker/css/images/ui-bg_fine-grain_15_d3c05a_60x60.png +0 -0
  34. data/vendor/multiple-dates-picker/css/images/ui-bg_fine-grain_15_eceadf_60x60.png +0 -0
  35. data/vendor/multiple-dates-picker/css/images/ui-bg_fine-grain_15_ffffff_60x60.png +0 -0
  36. data/vendor/multiple-dates-picker/css/images/ui-bg_fine-grain_65_654b24_60x60.png +0 -0
  37. data/vendor/multiple-dates-picker/css/images/ui-bg_fine-grain_68_b83400_60x60.png +0 -0
  38. data/vendor/multiple-dates-picker/css/images/ui-icons_222222_256x240.png +0 -0
  39. data/vendor/multiple-dates-picker/css/images/ui-icons_3572ac_256x240.png +0 -0
  40. data/vendor/multiple-dates-picker/css/images/ui-icons_8c291d_256x240.png +0 -0
  41. data/vendor/multiple-dates-picker/css/images/ui-icons_b83400_256x240.png +0 -0
  42. data/vendor/multiple-dates-picker/css/images/ui-icons_fbdb93_256x240.png +0 -0
  43. data/vendor/multiple-dates-picker/css/images/ui-icons_ffffff_256x240.png +0 -0
  44. data/vendor/multiple-dates-picker/css/mdp.css +126 -0
  45. data/vendor/multiple-dates-picker/css/pepper-ginder-custom.css +572 -0
  46. data/vendor/multiple-dates-picker/css/prettify.css +1 -0
  47. data/vendor/multiple-dates-picker/favicon.ico +0 -0
  48. data/vendor/multiple-dates-picker/img/sflogo.gif +0 -0
  49. data/vendor/multiple-dates-picker/img/valid-html401-blue.png +0 -0
  50. data/vendor/multiple-dates-picker/index.html +586 -0
  51. data/vendor/multiple-dates-picker/jquery-ui.multidatespicker.js +457 -0
  52. data/vendor/multiple-dates-picker/js/jquery-1.7.2.js +9404 -0
  53. data/vendor/multiple-dates-picker/js/jquery.ui.core.js +319 -0
  54. data/vendor/multiple-dates-picker/js/jquery.ui.datepicker-es.js +23 -0
  55. data/vendor/multiple-dates-picker/js/jquery.ui.datepicker.js +1826 -0
  56. data/vendor/multiple-dates-picker/js/lang-css.js +2 -0
  57. data/vendor/multiple-dates-picker/js/prettify.js +28 -0
  58. data/vendor/multiple-dates-picker/mdp-icon.png +0 -0
  59. metadata +103 -0
@@ -0,0 +1 @@
1
+ .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
@@ -0,0 +1,586 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <link rel="shortcut icon" href="favicon.ico">
6
+ <title>Multiple Dates Picker for jQuery UI</title>
7
+ <meta name="description" content="MDP is a little plugin that enables jQuery UI calendar to manage multiple dates.">
8
+ <meta name="keywords" content="Multiple Dates Picker, jQuery, jQuery UI, javascript, calendar, Luca Lauretta, dubrox">
9
+ <meta name="author" content="Luca Lauretta aka dubrox">
10
+
11
+ <!-- loads jquery and jquery ui -->
12
+ <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
13
+ <script type="text/javascript" src="js/jquery.ui.core.js"></script>
14
+ <script type="text/javascript" src="js/jquery.ui.datepicker.js"></script>
15
+ <!-- script type="text/javascript" src="js/jquery.ui.datepicker-es.js"></script -->
16
+
17
+ <!-- loads mdp -->
18
+ <script type="text/javascript" src="jquery-ui.multidatespicker.js"></script>
19
+
20
+ <!-- mdp demo code -->
21
+ <script type="text/javascript">
22
+ <!--
23
+ var latestMDPver = $.ui.multiDatesPicker.version;
24
+ var lastMDPupdate = '2012-03-28';
25
+
26
+ $(function() {
27
+ // Version //
28
+ //$('title').append(' v' + latestMDPver);
29
+ $('.mdp-version').text('v' + latestMDPver);
30
+ $('#mdp-title').attr('title', 'last update: ' + lastMDPupdate);
31
+
32
+ // Documentation //
33
+ $('i:contains(type)').attr('title', '[Optional] accepted values are: "allowed" [default]; "disabled".');
34
+ $('i:contains(format)').attr('title', '[Optional] accepted values are: "string" [default]; "object".');
35
+ $('#how-to h4').each(function () {
36
+ var a = $(this).closest('li').attr('id');
37
+ $(this).wrap('<'+'a href="#'+a+'"></'+'a>');
38
+ });
39
+ $('#demos .demo').each(function () {
40
+ var id = $(this).find('.box').attr('id') + '-demo';
41
+ $(this).attr('id', id)
42
+ .find('h3').wrapInner('<'+'a href="#'+id+'"></'+'a>');
43
+ });
44
+
45
+ // Run Demos
46
+ $('.demo .code').each(function() {
47
+ eval($(this).attr('title','NEW: edit this code and test it!').text());
48
+ this.contentEditable = true;
49
+ }).focus(function() {
50
+ if(!$(this).next().hasClass('test'))
51
+ $(this)
52
+ .after('<button class="test">test</button>')
53
+ .next('.test').click(function() {
54
+ $(this).closest('.demo').find('.box').removeClass('hasDatepicker').empty();
55
+ eval($(this).prev().text());
56
+ $(this).remove();
57
+ });
58
+ });
59
+ });
60
+ // -->
61
+ </script>
62
+
63
+ <!-- loads some utilities (not needed for your developments) -->
64
+ <link rel="stylesheet" type="text/css" href="css/mdp.css">
65
+ <link rel="stylesheet" type="text/css" href="css/prettify.css">
66
+ <script type="text/javascript" src="js/prettify.js"></script>
67
+ <script type="text/javascript" src="js/lang-css.js"></script>
68
+ <script type="text/javascript">
69
+ $(function() {
70
+ prettyPrint();
71
+ });
72
+ </script>
73
+
74
+ </head>
75
+ <body>
76
+ <div id="page">
77
+ <h1 id="mdp-title">Multiple Dates Picker <span class="mdp-version"></span> for jQuery UI</h1>
78
+ <p>
79
+ MDP is a little plugin that enables jQuery UI calendar to manage multiple dates with the following features:
80
+ </p>
81
+ <ul>
82
+ <li>Select date ranges.</li>
83
+ <li>Pick multiple dates not in secuence.</li>
84
+ <li>Define a maximum number of pickable dates.</li>
85
+ <li>Define a range X days from where it is possible to select Y dates.</li>
86
+ <li>Define unavailable dates.</li>
87
+ </ul>
88
+
89
+ <div id="ribbons">
90
+ <a href="http://github.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI" style="display:block; position: absolute; top: -3px; left: -3px; border: 0;">
91
+ <img style="border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/5d21241b64dc708fcbb701f68f72f41e9f1fadd6/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f7265645f6161303030302e706e67" alt="Fork me on GitHub">
92
+ </a>
93
+ </div>
94
+
95
+ <div id="share">
96
+ <div id="sf-logo-reference" style="width:88px;text-align:center;line-height: 0;background-color:black">
97
+ <a href="http://sourceforge.net/projects/multidatespickr">
98
+ <img src="http://sflogo.sourceforge.net/sflogo.php?group_id=358205&amp;type=8" style="width:80px;height:15px;border:0" alt="Get Multiple Dates Picker for jQuery UI at SourceForge.net. Fast, secure and Free Open Source software downloads">
99
+ </a>
100
+ </div>
101
+
102
+ <div id="sf-donate">
103
+ <a href="http://sourceforge.net/donate/index.php?group_id=358205">
104
+ <img src="http://images.sourceforge.net/images/project-support.jpg" style="width:88px;height:32px;border:0" alt="Support This Project">
105
+ </a>
106
+ </div>
107
+
108
+ <div id="tweet" style="padding-top: .5em;">
109
+ <a href="http://twitter.com/share" class="twitter-share-button">Tweet</a>
110
+ <script type="text/javascript">
111
+ <!-- // Fix for valid markup //
112
+ $('#tweet a')
113
+ .attr('data-count', 'vertical')
114
+ .attr('data-via','lucalauretta')
115
+ .attr('data-url','http://multidatespickr.sourceforge.net/')
116
+ .attr('data-text','Multiple Dates Picker v' + latestMDPver);
117
+ -->
118
+ </script>
119
+ <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
120
+ </div>
121
+ </div>
122
+
123
+ <div id="download">
124
+ <h2>Download</h2>
125
+ <p>
126
+ Download from <a href="https://sourceforge.net/projects/multidatespickr/">SourceForge</a>.
127
+ </p>
128
+ </div>
129
+
130
+ <div id="report">
131
+ <h2>Bugs or features request?</h2>
132
+ <p>Please use one of the following links:</p>
133
+ <ul>
134
+ <!-- li><a href="https://sourceforge.net/tracker/?group_id=358205">SourceForge Tracker</a></li -->
135
+ <li><a href="https://github.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/issues">GitHub Issues</a></li>
136
+ </ul>
137
+ </div>
138
+
139
+ <div id="how-to">
140
+ <h2>How to use it</h2>
141
+ <p>
142
+ Being an extension to jQuery UI DatePicker you need to include both jQuery and jQuery UI (with datepicker module included!) javascript files to your HTML page, and right after that, include MultiDatesPicker.
143
+ </p>
144
+ <p>
145
+ To apply it to an element, do it the same way as you would do with jQuery UI datepicker, but write multiDatesPicker instead of datepicker:
146
+ <br>
147
+ <code class="prettyprint">$(element_or_selector).multiDatesPicker(options_to_initialize_datepicker_and_multidatepicker);</code>
148
+ </p>
149
+
150
+ <h3>MultiDatesPicker specific options</h3>
151
+ <ul>
152
+ <li id="option-addDates">
153
+ <h4>addDates</h4>
154
+ <p>
155
+ Adds an array of dates specified in a string, milliseconds or javascript date object format.
156
+ <br>
157
+ <em>NOTE: the string format you should pass to multiDatePicker depends on the localization of datepicker, see this page for more infos on how to configure it.</em>
158
+ </p>
159
+ </li>
160
+ <li id="option-addDisabledDates">
161
+ <h4>addDisabledDates</h4>
162
+ <p>
163
+ Disables an array of dates specified in a string, milliseconds or javascript date object format.
164
+ <br>
165
+ <em>NOTE: the string format you should pass to multiDatePicker depends on the localization of datepicker, see this page for more infos on how to configure it.</em>
166
+ </p>
167
+ </li>
168
+ <li id="option-mode">
169
+ <h4>mode</h4>
170
+ <p>
171
+ Allows to enable a different MDP modes: 'normal' (default) or 'daysRange'.
172
+ </p>
173
+ <h4>normal mode options</h4>
174
+ <ul>
175
+ <li id="option-maxPicks">
176
+ <h4>maxPicks</h4>
177
+ <p>
178
+ Number of dates allowed to be selected (<a href="#maxPicks-demo">see demo</a>).
179
+ </p>
180
+ </li>
181
+ <li id="option-pickableRange">
182
+ <h4>pickableRange</h4>
183
+ <p>
184
+ Limits the range of dates available for selection to a certain number of days from the first selection (<a href="#pickableRange-demo">see demo</a>).
185
+ </p>
186
+ </li>
187
+ <li id="option-adjustRangeToDisabled">
188
+ <h4>adjustRangeToDisabled</h4>
189
+ <p>
190
+ A boolean that allows to maintain the number of pickable days even in case there are disabled days within the range specified in 'pickableRange'.<br>
191
+ See the <a href="#pickableRange-demo">corresponding demo</a> and try toggling this flag to see the results.
192
+ </p>
193
+ </li>
194
+ </ul>
195
+ <h4>daysRange mode options</h4>
196
+ <ul>
197
+ <li id="option-autoselectRange">
198
+ <h4>autoselectRange</h4>
199
+ <p>
200
+ Array of two integers: the first sets the beginning of the range relative to the date clicked on; the last sets the end of the range. Both numbers may be negative (<a href="##simple-select-days-range-demo">see demo</a>).
201
+ </p>
202
+ </li>
203
+ </ul>
204
+ </li>
205
+ </ul>
206
+
207
+ <h3>Available methods:</h3>
208
+ <ul>
209
+ <li id="method-compareDates">
210
+ <h4>compareDates( date1, date2 )</h4>
211
+ <p>
212
+ Compares two dates returning 1, 0 or -1 if date2 is greater, equal or smaller than date1 respectively.
213
+ </p>
214
+ </li>
215
+ <li id="method-gotDate">
216
+ <h4>gotDate( date, <i>type</i> )</h4>
217
+ <p>
218
+ Returns the index of the date in the dates array, or false in case that date is not found.
219
+ <br>
220
+ The parameter dates can be a string or a date object.
221
+ </p>
222
+ <p>Example: <code class="prettyprint">$('#simpliest-usage').multiDatesPicker('gotDate', new Date());</code></p>
223
+ </li>
224
+ <li id="method-addDates">
225
+ <h4>addDates( dates, <i>type</i> )</h4>
226
+ <p>
227
+ Adds one or more dates to the calendar.
228
+ <br>
229
+ The parameter dates can be a string, a date object or an array (of strings or javascript date objects).
230
+ </p>
231
+ <p>Example adding today: <code class="prettyprint">$('#simpliest-usage').multiDatesPicker('addDates', new Date());</code></p>
232
+ </li>
233
+ <li id="method-removeIndexes">
234
+ <h4>removeIndexes( indexes, <i>type</i> )</h4>
235
+ <p>
236
+ Removes one or more dates from the dates array using their indexes.
237
+ <br>
238
+ The parameter indexes can be an integer or an array of integers.
239
+ </p>
240
+ <p>Example removing first date: <code class="prettyprint">$('#simpliest-usage').multiDatesPicker('removeIndexes', 0);</code></p>
241
+ </li>
242
+ <li id="method-removeDates">
243
+ <h4>removeDates( dates, <i>type</i> )</h4>
244
+ <p>
245
+ Removes one or more dates from the dates array using their dates.
246
+ <br>
247
+ The parameter dates can be a single value or an array of milliseconds, strings or date object.
248
+ </p>
249
+ <p>Example removing today date: <code class="prettyprint">$('#simpliest-usage').multiDatesPicker('removeDates', new Date());</code></p>
250
+ </li>
251
+ <li id="method-resetDates">
252
+ <h4>resetDates( <i>type</i> )</h4>
253
+ <p>
254
+ Removes all dates.
255
+ <br>
256
+ The array of dates to reset can be of <i>type</i> 'picked' (default) or 'disabled'.
257
+ </p>
258
+ <p>Example resetting disabled dates: <code class="prettyprint">$('#simpliest-usage').multiDatesPicker('resetDates', 'disabled');</code></p>
259
+ </li>
260
+ <li id="method-toggleDate">
261
+ <h4>toggleDate( date, <i>type</i> )</h4>
262
+ <p>
263
+ Adds/removes a single date from the calendar.
264
+ <br>
265
+ The date can be passed as string or as javascript date object.
266
+ </p>
267
+ <p>Example toggling today: <code class="prettyprint">$('#simpliest-usage').multiDatesPicker('toggleDate', new Date());</code></p>
268
+ </li>
269
+ <li id="method-getDates">
270
+ <h4>getDates( <i>format</i>, <i>type</i> )</h4>
271
+ <p>
272
+ Retrives the array of dates associated with the multiDatesPicker in the specified format: "string" (default) for localized string format, or "object" for javascript date object format.
273
+ </p>
274
+ <p>Example: <code class="prettyprint">var dates = $('#simpliest-usage').multiDatesPicker('getDates');</code></p>
275
+ </li>
276
+ </ul>
277
+ </div>
278
+
279
+ <div id="use_cases">
280
+ <h2>Use cases</h2>
281
+ <p>
282
+ You can find MDP implemented in the following sites:
283
+ </p>
284
+ <ul>
285
+ <li>
286
+ <a href="http://avisooportunoexpress.mx">avisooportunoexpress.mx</a>
287
+ <br>
288
+ A Mexican website developed by me, aimed to sell advertisements on
289
+ <a href="http://www.eluniversal.com.mx">El Universal CPN</a>
290
+ mexican newspaper products.
291
+ </li>
292
+ </ul>
293
+ <p>
294
+ If you're using MDP in your site and would like to share it, simply <a href="#contactme">contact me</a>. You'd get free ad from here and we get more examples of implementation from you :)
295
+ </p>
296
+ </div>
297
+
298
+ <div id="demos">
299
+ <h2>Demos</h2>
300
+ <p>
301
+ Here are some demos for you to understand how it works and what you can obtain with it.<br>
302
+ To see how it is implemented simply check the source code of this page: I've tried to keep the code simple and clear :)
303
+ </p>
304
+ <ul id="demos-list">
305
+ <li class="demo first">
306
+ <h3>Simplest usage</h3>
307
+ <div id="simpliest-usage" class="box"></div>
308
+ <p class="description">
309
+ Just apply the plugin to an HTML element and you're ready to select multiple dates :)
310
+ </p>
311
+ <div class="code-box">
312
+ <h4>Code used</h4>
313
+ <pre class="code prettyprint">
314
+ $('#simpliest-usage').multiDatesPicker();
315
+ </pre>
316
+ </div>
317
+ </li>
318
+
319
+ <li class="demo">
320
+ <h3>Custom date format</h3>
321
+ <div id="custom-date-format" class="box"></div>
322
+ <p class="description">
323
+ Same as previous example, but using custom date formats and custom default day.
324
+ </p>
325
+ <div class="code-box">
326
+ <h4>Code used</h4>
327
+ <pre class="code prettyprint">
328
+ $('#custom-date-format').multiDatesPicker({
329
+ dateFormat: "yy-mm-dd",
330
+ defaultDate:"85-02-19"
331
+ });</pre>
332
+ </div>
333
+ </li>
334
+
335
+ <li class="demo">
336
+ <h3>Pre-select dates</h3>
337
+ <div id="pre-select-dates" class="box"></div>
338
+ <p class="description">
339
+ The name says it all: you can preselect some dates specifying them in an array.<br>
340
+ Dates in the array can be a mix of object date and string dates.
341
+ </p>
342
+ <p class="example">
343
+ In this example we've preselected the 14th and 19th of the current month.
344
+ </p>
345
+ <div class="code-box">
346
+ <h4>Code used</h4>
347
+ <pre class="code prettyprint">
348
+ var date = new Date();
349
+ $('#pre-select-dates').multiDatesPicker({
350
+ addDates: [date.setDate(14), date.setDate(19)]
351
+ });</pre>
352
+ </div>
353
+ </li>
354
+
355
+ <li class="demo">
356
+ <h3>Disable dates</h3>
357
+ <div id="disable-dates" class="box"></div>
358
+ <p class="description">
359
+ Again, the name says it all: you can specify some dates to disable.<br>
360
+ Dates in the array can be a mix of object date and string dates.
361
+ </p>
362
+ <p class="example">
363
+ In this example are disabled the first and third day of the current month.
364
+ </p>
365
+ <div class="code-box">
366
+ <h4>Code used</h4>
367
+ <pre class="code prettyprint">
368
+ var today = new Date();
369
+ $('#disable-dates').multiDatesPicker({
370
+ addDisabledDates: [today.setDate(1), today.setDate(3)]
371
+ });</pre>
372
+ </div>
373
+ </li>
374
+
375
+ <li class="demo">
376
+ <h3>Disable calendar</h3>
377
+ <div id="disable-calendar" class="box"></div>
378
+ <p class="description">
379
+ Disable a calendar picking functionality.
380
+ </p>
381
+ <p class="example">
382
+ Today and tomorrow are selected just to show how selected dates looks in a disabled calendar.
383
+ </p>
384
+ <div class="code-box">
385
+ <h4>Code used</h4>
386
+ <pre class="code prettyprint">
387
+ var today = new Date();
388
+ var tomorrow = (new Date()).setDate(today.getDate()+1);
389
+ $('#disable-calendar').multiDatesPicker({
390
+ disabled: true,
391
+ addDates: [today, tomorrow]
392
+ });</pre>
393
+ </div>
394
+ </li>
395
+
396
+ <li class="demo">
397
+ <h3>Custom methods</h3>
398
+ <div id="custom-methods" class="box"></div>
399
+ <p class="description">
400
+ Define 'beforeShow', 'beforeShowDay'<a class="reference-to" href="#custom-methods-reference">*</a>, 'onSelect' and 'onClose' to apply custom behaviours.
401
+ </p>
402
+ <p class="important-note" id="custom-methods-reference">
403
+ <span class="reference-to">*</span> Being that MDP needs 'beforeShowDay' method to change the way jQuery datepicker behaves, there may be cases in which your custom definition in MDP won't produce the same effects as if you were using it with datepicker alone.<br>
404
+ Note that, disabling dates using 'beforeShowDay' will produce undesired results with MDP functionalities that involves ranges, because MDP will still consider those dates as available.
405
+ </p>
406
+ <div class="code-box">
407
+ <h4>Code used</h4>
408
+ <pre class="code prettyprint">
409
+ $('#custom-methods').multiDatesPicker({
410
+ beforeShowDay: $.datepicker.noWeekends
411
+ });
412
+ </pre>
413
+ </div>
414
+ </li>
415
+
416
+ <li class="demo">
417
+ <h3>Using altField</h3>
418
+ <div class="box">
419
+ <div id="with-altField"></div>
420
+ <input type="text" id="altField">
421
+ </div>
422
+ <p class="description">
423
+ A way to have a calendar always displayed and a field that fills with selected dates.
424
+ </p>
425
+ <div class="code-box">
426
+ <h4>Code used</h4>
427
+ <pre class="code prettyprint">
428
+ $('#with-altField').multiDatesPicker({
429
+ altField: '#altField'
430
+ });</pre>
431
+ </div>
432
+ </li>
433
+
434
+ <li class="demo">
435
+ <h3>Set maximum picks</h3>
436
+ <div id="maxPicks" class="box"></div>
437
+ <p class="description">
438
+ Set the maximum number of dates that can be picked.
439
+ </p>
440
+ <div class="code-box">
441
+ <h4>Code used</h4>
442
+ <pre class="code prettyprint">
443
+ $('#maxPicks').multiDatesPicker({
444
+ maxPicks: 2
445
+ });
446
+ </pre>
447
+ </div>
448
+ </li>
449
+
450
+ <li class="demo">
451
+ <h3>Use pickableRange and adjustRangeToDisabled</h3>
452
+ <div id="pickableRange" class="box"></div>
453
+ <p class="description">
454
+ Define a range of dates to be allowed after the first date have been picked.<br>
455
+ Some dates have been disabled to allow testing of adjustRangeToDisabled.
456
+ </p>
457
+ <div class="code-box">
458
+ <h4>Code used</h4>
459
+ <pre class="code prettyprint">
460
+ var date = new Date();
461
+ $('#pickableRange').multiDatesPicker({
462
+ pickableRange: 7,
463
+ adjustRangeToDisabled: true,
464
+ addDisabledDates: [date.setDate(10), date.setDate(15)]
465
+ });
466
+ </pre>
467
+ </div>
468
+ </li>
469
+
470
+ <li class="demo">
471
+ <h3>Days Range Mode: Auto Select Range</h3>
472
+ <div id="simple-select-days-range" class="box"></div>
473
+ <p class="description">
474
+ This way you can automatically select a range of days with respect to the day clicked.
475
+ </p>
476
+ <p class="example">
477
+ In this example the day range is set to [0, 5], which means from the day clicked to 5 days in advance.<br>
478
+ You can also specify other combinations like:
479
+ </p>
480
+ <ul>
481
+ <li>[-1,2] from a day before to two days after the clicked day</li>
482
+ <li>[1,3] from the day after to three days after the clicked day</li>
483
+ <li>...</li>
484
+ </ul>
485
+ <div class="code-box">
486
+ <h4>Code used</h4>
487
+ <pre class="code prettyprint">
488
+ $('#simple-select-days-range').multiDatesPicker({
489
+ mode: 'daysRange',
490
+ autoselectRange: [0,5]
491
+ });</pre>
492
+ </div>
493
+ </li>
494
+
495
+ <li class="demo">
496
+ <h3>From input</h3>
497
+ <div class="box">
498
+ <input type="text" id="from-input">
499
+ </div>
500
+ <p class="description">
501
+ Just an example of how it would work with an input text field.
502
+ </p>
503
+ <div class="code-box">
504
+ <h4>Code used</h4>
505
+ <pre class="code prettyprint">
506
+ $('#from-input').multiDatesPicker();
507
+ </pre>
508
+ </div>
509
+ </li>
510
+
511
+ <li class="demo full-row">
512
+ <h3>Full year</h3>
513
+ <div id="full-year" class="box"></div>
514
+ <p class="description">
515
+ Just an example of how it would look to show the full year.
516
+ </p>
517
+ <div class="code-box">
518
+ <h4>Code used</h4>
519
+ <pre class="code prettyprint">
520
+ var today = new Date();
521
+ var y = today.getFullYear();
522
+ $('#full-year').multiDatesPicker({
523
+ addDates: ['10/14/'+y, '02/19/'+y, '01/14/'+y, '11/16/'+y],
524
+ numberOfMonths: [3,4],
525
+ showCurrentAtPos: today.getMonth()
526
+ });</pre>
527
+ </div>
528
+ </li>
529
+ </ul>
530
+ <div class="clear"></div>
531
+ </div>
532
+
533
+ <div id="tips">
534
+ <h2>Tips</h2>
535
+ <ul>
536
+ <li>
537
+ <p>To avoid the ugly jitter effect for picked dates, you can add the following code to your css:</p>
538
+ <pre class="code prettyprint lang-css">/* begin: jQuery UI Datepicker moving pixels fix */
539
+ table.ui-datepicker-calendar {border-collapse: separate;}
540
+ .ui-datepicker-calendar td {border: 1px solid transparent;}
541
+ /* end: jQuery UI Datepicker moving pixels fix */</pre>
542
+ </li>
543
+ <li>
544
+ <p>To add emphasis to the selected dates, you can add the following code to your css:</p>
545
+ <pre class="code prettyprint lang-css">/* begin: jQuery UI Datepicker emphasis on selected dates */
546
+ .ui-datepicker .ui-datepicker-calendar .ui-state-highlight a {
547
+ background: #743620 none; /* a color that fits the widget theme */
548
+ color: white; /* a color that is readeable with the color above */
549
+ }
550
+ /* end: jQuery UI Datepicker emphasis on selected dates */</pre>
551
+ </li>
552
+ </ul>
553
+ <p>
554
+ To even further customize the way the calendar looks, just modify the jQuery UI's theme you're using.<br>
555
+ Multiple Dates Picker is about adding functionality not style :)
556
+ </p>
557
+ </div>
558
+
559
+ <div id="to-do">
560
+ <h2>Things pending</h2>
561
+ <p>Apart from some features and bug fixes, there is need for a better documentation and a unit-test to guarantee that any improvements won't break the existent functionalities.</p>
562
+ <p>I'll try to maintain this project in my spare time (it is not my primary business), and I welcome anyone who wants to help (just <a href="#contactme">contact me</a> :)</p>
563
+ </div>
564
+
565
+ <div id="contactme">
566
+ <h2>Contact me</h2>
567
+ <p>You're welcome to get in touch with me to collaborate to this project:</p>
568
+ <ul>
569
+ <li><a href="http://luca.lauretta.info">luca.lauretta.info</a> <em>please do not email me for support or bug reporting, use <a href="#report">report section</a> instead.</em></li>
570
+ </ul>
571
+ </div>
572
+ </div>
573
+ <div id="flairs">
574
+ <ul>
575
+ <li>
576
+ <!-- sourceforge -->
577
+ <a href="http://sourceforge.net/projects/multidatespickr"><img src="img/sflogo.gif" width="120" height="30" alt="Get Multiple Dates Picker for jQuery UI at SourceForge.net. Fast, secure and Free Open Source software downloads"></a>
578
+ </li>
579
+ <li>
580
+ <!-- valid html -->
581
+ <a href="http://validator.w3.org/check?uri=http://multidatespickr.sourceforge.net"><img alt="Valid HTML4.01" src="img/valid-html401-blue.png"></a>
582
+ </li>
583
+ </ul>
584
+ </div>
585
+ </body>
586
+ </html>