DMXzone Calendar Support Product Page

Can't insert dates prior to 2001

Asked 26 Feb 2011 22:37:32
1
has this question
26 Feb 2011 22:37:32 Jeff Spijkers posted:
I have been searching for a solution to this problem and need help desperately.

I need to add a calendar to a record update form that will allow me to add a date of birth at least as far back as 1960 preferable 1950 to 2020

Can anyone help me? I really need an answer as soon as possible.

Thanks to all.

Replies

Replied 07 Mar 2011 20:52:07
07 Mar 2011 20:52:07 Nelson Therrien replied:
I hope it's not already too late (unfortunately, if it is, I hope it can help others)...

This is a jQuery feature (DMXzone Calendar is based on the jQuery datepicker)...

By default, it shows 10 years before and 10 years after.

You can add in the code a parameter that will allow you to change the date range.

Here's an exerpt from jQuery's documentation:
"Control the range of years displayed in the year drop-down: either relative to today's year (-nn:+nn), relative to the currently selected year (c-nn:c+nn), absolute (nnnn:nnnn), or combinations of these formats (nnnn:-nn). Note that this option only affects what appears in the drop-down, to restrict which dates may be selected use the minDate and/or maxDate options."

So, in your case, you could add: yearRange : "1950:2020" or yearRange : "1950:+10" if you don't want to have to update it later...

Now, where to put that??
In code view, with version 1.0.6 (latest out today), you should see something similar to this:
defaultDate : "+0"
}).attr("readonly", "readonly";})
// ]]>
</script>
The first line depends on your options... So, after the last option (defaultDate : "+0" in this case), add a coma and then the yearRange option. So, in your case, it would give something like that:
defaultDate : "+0",
yearRange : "1950:2020"
}).attr("readonly", "readonly";})
// ]]>
</script>

By the way, since it's for a date of birth, it's not really logical to allow years after this year, so you could instead put yearRange : "1950:+0", which will put this year... or for example yearRange : "1950:-13" if you don't want people under 13 (for example) to access your site...
Replied 08 Mar 2011 13:56:56
08 Mar 2011 13:56:56 Miroslav Zografski replied:
Hello,

For now this option is out of the UI.

We will see to add it in the future.

Regards,
Replied 06 Apr 2011 20:23:08
06 Apr 2011 20:23:08 Jeff Spijkers replied:
Thank you so much. This really helped tremendously! Now I understand much more clearly. Although I am hopeful that this will become an option in the Extension's U.I. soon.

QuoteI hope it's not already too late (unfortunately, if it is, I hope it can help others)...

This is a jQuery feature (DMXzone Calendar is based on the jQuery datepicker)...

By default, it shows 10 years before and 10 years after.

You can add in the code a parameter that will allow you to change the date range.

Here's an exerpt from jQuery's documentation:
"Control the range of years displayed in the year drop-down: either relative to today's year (-nn:+nn), relative to the currently selected year (c-nn:c+nn), absolute (nnnn:nnnn), or combinations of these formats (nnnn:-nn). Note that this option only affects what appears in the drop-down, to restrict which dates may be selected use the minDate and/or maxDate options."

So, in your case, you could add: yearRange : "1950:2020" or yearRange : "1950:+10" if you don't want to have to update it later...

Now, where to put that??
In code view, with version 1.0.6 (latest out today), you should see something similar to this:
defaultDate : "+0"
}).attr("readonly", "readonly";})
// ]]>
</script>
The first line depends on your options... So, after the last option (defaultDate : "+0" in this case), add a coma and then the yearRange option. So, in your case, it would give something like that:
defaultDate : "+0",
yearRange : "1950:2020"
}).attr("readonly", "readonly";})
// ]]>
</script>

By the way, since it's for a date of birth, it's not really logical to allow years after this year, so you could instead put yearRange : "1950:+0", which will put this year... or for example yearRange : "1950:-13" if you don't want people under 13 (for example) to access your site...

Reply to this topic