close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Calendar Initial Date

Thread began 10/24/2012 3:53 pm by jo271221 | Last modified 11/05/2012 11:26 am by Jason Byrnes | 802 views | 5 replies |

jo271221

Calendar Initial Date

I was able to add a default CURDATE to my calendar. Can you help me with the code for something like CURDATE + 1YR (current date plus 1 year). Thank You,

Sign in to reply to this post

CraigRBeta Tester

i would do it like this...

within the datepicker function add the following option.

defaultDate: '+1y +1d'

see Datepicker#option-defaultDate for more info

Sign in to reply to this post

jo271221

Sorry, do I add that code to the script somewhere?

Initial date 30 days in future - $( ".selector" ).datepicker({ defaultDate: +7 });

<script type="text/javascript">
$(function(){
$('#datepicker_27').datepicker({
dateFormat: 'yy/mm/dd',
showAnim: 'show',
onClose: closeDatePicker_datepicker_27
});
});
function closeDatePicker_datepicker_27() {
var tElm = $('#datepicker_27');
if (typeof datepicker_27_Spry != null && typeof datepicker_27_Spry != "undefined" && adexpires_Spry.validate) {
datepicker_27_Spry.validate();
}
var docElm = document.getElementById("datepicker_27");
var tBlur = docElm.getAttribute("onBlur");
if (!tBlur) tBlur = docElm.getAttribute("onblur");
if (!tBlur) tBlur = docElm.getAttribute("ONBLUR");
if (tBlur) {
tBlur = String(tBlur).replace(/\bthis\b/g, "docElm");
eval(tBlur);
}
}
</script>

My insert and update page contains multiple date fields in case that makes a difference.

Thank You,

Thank You!!

Sign in to reply to this post

Jason ByrnesWebAssist

you would add it to the list or arguments or configuring the datepicker.

the datepicker is created using this section of code:
$(function(){
$('#datepicker_27').datepicker({
dateFormat: 'yy/mm/dd',
showAnim: 'show',
onClose: closeDatePicker_datepicker_27
});
});



add the default date to the list of arguments:
$(function(){
$('#datepicker_27').datepicker({
defaultDate: '+30d'
dateFormat: 'yy/mm/dd',
showAnim: 'show',
onClose: closeDatePicker_datepicker_27
});
});

Sign in to reply to this post

jo271221

Am I missing something? nothing inserted

Am I missing something? Nothing was inserted.

<script type="text/javascript">
$(function(){
$('#datepicker_27').datepicker({
defaultDate: '+30d',
dateFormat: 'yy/mm/dd',
showAnim: 'show',
onClose: closeDatePicker_datepicker_27
});
});
function closeDatePicker_datepicker_27() {
var tElm = $('#datepicker_27');
if (typeof datepicker_27_Spry != null && typeof datepicker_27_Spry != "undefined" && adexpires_Spry.validate) {
datepicker_27_Spry.validate();
}
var docElm = document.getElementById("datepicker_27");
var tBlur = docElm.getAttribute("onBlur");
if (!tBlur) tBlur = docElm.getAttribute("onblur");
if (!tBlur) tBlur = docElm.getAttribute("ONBLUR");
if (tBlur) {
tBlur = String(tBlur).replace(/\bthis\b/g, "docElm");
eval(tBlur);
}
}
</script>

Sign in to reply to this post

Jason ByrnesWebAssist

I dont follow, please provide more details

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...