NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Niels Larsen on August 11, 2010, 07:42:30 AM
-
Hi
I have played with Datepicker and it's greate!!
The only thing I need to finish my project is the ability to disable single days.
One step could be to implement the uility function noWeekends( )
A small hint would be a great help...
Regards Niels Larsen
-
The Weekends part is easy, in the embed right before the date is generated set
loc:options = 'beforeShowDay: jQuery.datepicker.noWeekends'
Adding other individual days, like public holidays and so on is a bit harder. but there's some really useful information on doing this here;
http://stackoverflow.com/questions/501943/can-the-jquery-ui-datepicker-be-made-to-disable-saturdays-and-sundays-and-holida (http://stackoverflow.com/questions/501943/can-the-jquery-ui-datepicker-be-made-to-disable-saturdays-and-sundays-and-holida)
Cheers
Bruce
-
Thanks - I'll give it a try..
-
Bruce, I cant make it work.
If I add the loc:option....
The date picker button disapears.
Alberto
-
Hi Alberto
This works for me:
loc:options = CLIP(loc:options) & ',beforeShowDay: jQuery.datepicker.noWeekends'
/Niels
-
Hi
Now my script to disable individual dates works. But only if I add it as a global script.
I would like to generate it at runtime. Any way to but something above the </head> on a webForm??
/Niels
-
Hi Alberto,
Usually means the string is wrong in some way. Be careful deciding whether to add your new options to the existing options, or to create new options. If your string is wrong though, the date lookup fails.
cheers
Bruce
-
Hi Niels,
it doesn't have to be in the <head> - anywhere on the page is fine.
A form is a control (as is a browse) so it doesn't have a <head> section - the head section is only on the page on which the browse / form is located.
cheers
Bruce
-
It works. ;D
Thanks Bruce. Great to learn something new. Life is wonderful ...
-
Now my script to disable individual dates works.
Neils, please, may you share your code?
Thanks
Alberto
-
Bruce, I dont know which PR are Neils using, I´m using PR28, but I´ve tried with his code:
loc:options = CLIP(loc:options) & ',beforeShowDay: jQuery.datepicker.noWeekends'
and the date picker button dissapears.
Alberto
-
Hi Alberto
I have modifyed example 1. Added date options on the first date-field in the MailboxesFormControl.
Se attached app+dct C63 9059 NT PR28
God luck
/Niels
[attachment deleted by admin]
-
Hi Alberto,
If loc:options is blank before your line (which it may be) then you mustn't add the leading ','.
Cheers
Bruce