Skip to content

Commit

Permalink
Adds more date range examples to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
trentrichardson committed Aug 21, 2014
1 parent 915d275 commit 72d56ca
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 18 deletions.
65 changes: 56 additions & 9 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -913,15 +913,62 @@ <h3 id="range_examples">Time Ranges</h3>
var endDateTextBox = $('#range_example_2_end');

$.timepicker.datetimeRange(
startDateTextBox,
endDateTextBox,
{
minInterval: (1000*60*60),
dateFormat: 'dd M yy',
timeFormat: 'HH:mm',
start: {}, // start picker options
end: {} // end picker options
}
startDateTextBox,
endDateTextBox,
{
minInterval: (1000*60*60), // 1hr
dateFormat: 'dd M yy',
timeFormat: 'HH:mm',
start: {}, // start picker options
end: {} // end picker options
}
);
</pre>
</div>

<!-- ============= example -->
<div class="example-container">
<p>To use only times for a time range use $.timepicker.timeRange():</p>
<div>
<input type="text" name="range_example_3_start" id="range_example_3_start" value="09:16" />
<input type="text" name="range_example_3_end" id="range_example_3_end" value="10:16" />
</div>
<pre>
var startTimeTextBox = $('#range_example_3_start');
var endTimeTextBox = $('#range_example_3_end');

$.timepicker.timeRange(
startTimeTextBox,
endTimeTextBox,
{
minInterval: (1000*60*60), // 1hr
timeFormat: 'HH:mm',
start: {}, // start picker options
end: {} // end picker options
}
);
</pre>
</div>

<!-- ============= example -->
<div class="example-container">
<p>Even though this plugin focuses on datetime, it also provides a dateRange function:</p>
<div>
<input type="text" name="range_example_4_start" id="range_example_4_start" value="" />
<input type="text" name="range_example_4_end" id="range_example_4_end" value="" />
</div>
<pre>
var startDateTextBox = $('#range_example_4_start');
var endDateTextBox = $('#range_example_4_end');

$.timepicker.dateRange(
startDateTextBox,
endDateTextBox,
{
minInterval: (1000*60*60*24*4), // 4 days
start: {}, // start picker options
end: {} // end picker options
}
);
</pre>
</div>
Expand Down
65 changes: 56 additions & 9 deletions src/docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,62 @@ <h3 id="range_examples">Time Ranges</h3>
var endDateTextBox = $('#range_example_2_end');

$.timepicker.datetimeRange(
startDateTextBox,
endDateTextBox,
{
minInterval: (1000*60*60),
dateFormat: 'dd M yy',
timeFormat: 'HH:mm',
start: {}, // start picker options
end: {} // end picker options
}
startDateTextBox,
endDateTextBox,
{
minInterval: (1000*60*60), // 1hr
dateFormat: 'dd M yy',
timeFormat: 'HH:mm',
start: {}, // start picker options
end: {} // end picker options
}
);
</pre>
</div>

<!-- ============= example -->
<div class="example-container">
<p>To use only times for a time range use $.timepicker.timeRange():</p>
<div>
<input type="text" name="range_example_3_start" id="range_example_3_start" value="09:16" />
<input type="text" name="range_example_3_end" id="range_example_3_end" value="10:16" />
</div>
<pre>
var startTimeTextBox = $('#range_example_3_start');
var endTimeTextBox = $('#range_example_3_end');

$.timepicker.timeRange(
startTimeTextBox,
endTimeTextBox,
{
minInterval: (1000*60*60), // 1hr
timeFormat: 'HH:mm',
start: {}, // start picker options
end: {} // end picker options
}
);
</pre>
</div>

<!-- ============= example -->
<div class="example-container">
<p>Even though this plugin focuses on datetime, it also provides a dateRange function:</p>
<div>
<input type="text" name="range_example_4_start" id="range_example_4_start" value="" />
<input type="text" name="range_example_4_end" id="range_example_4_end" value="" />
</div>
<pre>
var startDateTextBox = $('#range_example_4_start');
var endDateTextBox = $('#range_example_4_end');

$.timepicker.dateRange(
startDateTextBox,
endDateTextBox,
{
minInterval: (1000*60*60*24*4), // 4 days
start: {}, // start picker options
end: {} // end picker options
}
);
</pre>
</div>
Expand Down

0 comments on commit 72d56ca

Please sign in to comment.