Step by step tutorial regarding datepicker basic modifications.
you will need to edit the date picker javascript code.
the code may look like:
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
onClose: closeDatePicker_datepicker_1
});
});
you will need to add minDate: '+0'
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
minDate: '+0',
onClose: closeDatePicker_datepicker_1
});
});
the code may look like:
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
onClose: closeDatePicker_datepicker_1
});
});
you will need to add firstDay: 1
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
firstDay: 1,
onClose: closeDatePicker_datepicker_1
});
});
the code may look like:
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
onClose: closeDatePicker_datepicker_1
});
});
you will need to add showWeek: true
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
showWeek: true,
onClose: closeDatePicker_datepicker_1
});
});
the code may look like:
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
onClose: closeDatePicker_datepicker_1
});
});
you will need to add numberOfMonths: [2, 3]
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
numberOfMonths: [2, 3],
onClose: closeDatePicker_datepicker_1
});
});
This would show 6 months in 2 rows and 3 columns
English / Western formatting is the default. You will need to edit the date picker javascript code and add code that replace the default values
the code may look like:
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
onClose: closeDatePicker_datepicker_1
});
});
you would need to manually add values in your own language for
prevText:
nextText:
monthNames:
dayNamesMin:
weekHeader:
Here's how it's works in Norwegian
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
prevText: 'Forrige',
nextText: 'Neste',
monthNames: ['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
weekHeader: 'Uke',
onClose: closeDatePicker_datepicker_1
});
});
Display the datepicker embedded in the page instead of in an overlay. Simply call .datepicker() on a div instead of an input.
change
<input id="datepicker_1" name="datepicker_1" type="text" />
To
<div id="datepicker_1"></div>
Restrict the range of selectable dates with the minDate and maxDate options. Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)), as a numeric offset from today (-20), or as a string of periods and units ('+1M +10D'). For the last, use 'D' for days, 'W' for weeks, 'M' for months, or 'Y' for years.
the code may look like:
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'mm/dd/yy',
showAnim: 'show',
minDate: '-20',
maxDate: '+1M +10D'
onClose: closeDatePicker_datepicker_1
});
});
Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.
Sign in to add commentsYour friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.
this_is_me: 11 Years, 4 Months, 4 Weeks, 2 Days, 21 Hours, 3 Minutes ago
Great and very helpful explanations about this complicated thing. Thanks a lot!
I would love to see some tutorials with European date formats - ther are some issues still. Like dd.mm.yy
Jolter: 10 Years, 1 Month, 2 Weeks, 21 Hours, 58 Minutes ago
Thanks - very useful