/    Sign up×
Community /Pin to ProfileBookmark

datechooser class

I work with datechooser class [url]http://yellow5.us/projects/datechooser/[/url]

I want to change allowed days after initialization of the calendar

initialization (head)

[code]

function WindowLoad()
{
var objEarlyDateEx3 = new Date();
objEarlyDateEx3.setMonth(objEarlyDateEx3.getMonth());
var objLateDateEx3 = new Date();
objLateDateEx3.setMonth(objLateDateEx3.getMonth() + 1);

ndExample3 = document.getElementById(‘datechooserex3’);
ndExample3.DateChooser = new DateChooser();
ndExample3.DateChooser.setCloseTime(400);
ndExample3.DateChooser.setYOffset(5);
ndExample3.DateChooser.setUpdateField([‘monthselectex3’, ‘dayselectex3’, ‘yearselectex3’], [‘m’, ‘d’, ‘Y’]);
ndExample3.DateChooser.setIcon(‘datechooser.png’, ‘monthselectex3’, false, ‘Click for example 3’);

return true;
}

events.add(window, ‘load’, WindowLoad);

[/code]

so in body :

[code]
<p id=”datechooserex3″> …. </p>
<script>
ndExample3.DateChooser.setAllowedDays([‘2’, ‘3’, ‘4’]);
</script>
[/code]

but allowed days doesn’t change …

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@WebnerdSep 28.2007 — Try using integers instead of string values:

<i>
</i>ndExample3.DateChooser.setAllowedDays([2, 3, 4]);
Copy linkTweet thisAlerts:
@mac_umatikauthorSep 28.2007 — nothing happend using int..
Copy linkTweet thisAlerts:
@WebnerdSep 28.2007 — contact the creator of the script
Copy linkTweet thisAlerts:
@mac_umatikauthorSep 28.2007 — ok I will, but the code is correct ? is mean that something is wrong with setAllowedDays method ?
Copy linkTweet thisAlerts:
@Orc_ScorcherSep 28.2007 — ndExample3 is a variable that doesn't have a value before the WindowLoad function runs. Take another look at the example page from where you copied that code from, the setAllowedDays call is grouped together with the other method calls.
Copy linkTweet thisAlerts:
@mac_umatikauthorSep 29.2007 — almost work but, I have written some function:

showhdden() witch is for hidding elements ad q() fuction witch contain p tag with calendar

but it don't work ..I don't understand why ...
<i>
</i>events.add(window, 'load', WindowLoad);

function WindowLoad()
{

<i> </i>return true;
}

function FunctionEx1(objDate)
{
// objDate is a plain old Date object, with the getPHPDate() property added on.
document.getElementById('aa2').value = objDate.getPHPDate('Y-n-j');
return true;
}

function q(){
showhidden('kalendarz')
document.getElementById('k').innerHTML = "&lt;p id="datechooserex5" class="datechooser dc-alloweddays='1,4' dc-textlink='Example me' dc-dateformat='Y-n-j' dc-onupdate='FunctionEx1'"&gt;&lt;/p&gt;"
}
function showhidden(obj){
obj = document.getElementById(obj);
obj.style.display == 'none' ? obj.style.display = '' : obj.style.display ='none';
}

&lt;div id="kalendarz"&gt;
&lt;input type="text" id="aa2" class="aa2"&gt;&lt;div id="k"&gt;&lt;p id="datechooserex5" class="datechooser dc-alloweddays='1,4' dc-textlink='Example me' dc-dateformat='Y-n-j' dc-onupdate='FunctionEx1'"&gt;&lt;/p&gt;&lt;/div&gt;
&lt;script&gt;showhidden('kalendarz')&lt;/script&gt;
&lt;/div&gt;
&lt;a href="javascript:q()"&gt;aaa&lt;/a&gt;


but if I do:
<i>
</i>function q(){
document.getElementById('k').innerHTML = "&lt;p id="datechooserex5" class="datechooser dc-alloweddays='1,4' dc-textlink='Example me' dc-dateformat='Y-n-j' dc-onupdate='FunctionEx1'"&gt;&lt;/p&gt;"
}

&lt;div id="kalendarz"&gt;
&lt;input type="text" id="aa2" class="aa2"&gt;&lt;div id="k"&gt;&lt;/div&gt;
&lt;script&gt;q()&lt;/script&gt;
&lt;/div&gt;


all work perfect
×

Success!

Help @mac_umatik spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...