defaultYear

16 years 6 months ago #45410 by mert
defaultYear was created by mert
helle

in cb date area year is from 1900 to 2119 ,
i just use date tab for birthdays
so i need years from 1940-1990 ... how shoul i hack the code?
i have tried to change

var y = defaultYear - 67;
if (digits == 2) {
yearsToShow = 50;

but now when a user sellect a day or mounth the year field is empty ,

i think i may make default year to 1970 or something , but i dont know how can i,:unsure:
please help :)

Please Log in to join the conversation.

16 years 6 months ago #45493 by beat
Replied by beat on topic Re:defaultYear
You would need to hack js code....

We plan to make this configurable in the future.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

16 years 6 months ago #45661 by mert
Replied by mert on topic Re:defaultYear
could you please tell me how? i did try to change something in calendardateinput.js on line 664
from
var y = defaultYear - 107;
if (digits == 2) {
yearsToShow = 100;
to

var y = defaultYear - 67;
if (digits == 2) {
yearsToShow = 50;

but when a user add first a day or a mount the year is empty because 2007 is not in the range , so i need to change default year from 2007 to 1980 or something in the range , is it true my point of view? if so how could i change the default year from 2007 to 1980

Please Log in to join the conversation.

16 years 1 month ago #56212 by eroni
Replied by eroni on topic Re:defaultYear
just curious, did you ever figure out a work-around for defaultYear so it the range is not 2120?

Please Log in to join the conversation.

16 years 1 month ago #57107 by PureBlogic
Replied by PureBlogic on topic Re:defaultYear
I don't know if you have already got it, but, you don't really have to change much of the code.

There is a variable in calendardateinput.js that allows you to specify how many years are shown.

var yearsToShow = 220;

The default for yearsToShow is 220. If you change this, you can restrict the ending year. If you want to change the beginning year, then you will need to change more of the code.

Hope this works for you.

Please Log in to join the conversation.

16 years 5 days ago #59584 by Foton
Replied by Foton on topic Re:defaultYear
Try changing this:

var yearsToShow = 50;
var modulo = 10000;
var y = defaultYear - 67;
if (digits == 2) {
yearsToShow = 100;
modulo = 100;
y = cbcalY2kPivotPoint;

So change var yearsToShow
The starting year is defaultYear(=2008) - 67 = 1941 and the ending year will be 1941 + yearsToShow (=50) = 1990

HTH

Post edited by: Foton, at: 2008/03/24 02:28

Post edited by: Foton, at: 2008/03/24 02:29

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.488 seconds

Facebook Twitter LinkedIn