Holidays highlight in ui.datepicker

576 views
Skip to first unread message

Antonello Pasella

unread,
Jun 17, 2009, 4:29:19 AM6/17/09
to jQuery UI Development
I wrote a patch to allow highlighting of holidays in datepicker
instances.

See http://dev.jqueryui.com/ticket/4610

maybe we would change ui-state-highlight to a more appropriate state
(see line 1398 at ui.datepicker.js attached to the ticked)

Ca-Phun Ung

unread,
Jun 17, 2009, 7:55:55 AM6/17/09
to jquery...@googlegroups.com
Interesting approach. Btw, you could do this with the beforeShowDay event aswell, see this example:

http://jsbin.com/idubu

Go to Dec 09 and hover over one of the days with a red border.
--
Ca-Phun Ung
+ http://yelotofu.com
+ hongkong, zce, jquery, jqueryui, php, css, html

Antonello Pasella

unread,
Jun 17, 2009, 8:19:48 AM6/17/09
to jQuery UI Development
Yes, I knew that.
But I think that BeforeShowDay (IMHO) is related to "application
events" and not to "calendar event" as week-end highlight and weekend
days show/hide
and some regional features (like weekend day, firstDay of the week)
would be included by regional settings.

Ca-Phun Ung

unread,
Jun 17, 2009, 1:54:51 PM6/17/09
to jquery...@googlegroups.com
On Wed, Jun 17, 2009 at 8:19 PM, Antonello Pasella <antonell...@gmail.com> wrote:

Yes, I knew that.
But I think that BeforeShowDay (IMHO) is related to "application
events" and not to "calendar event" as week-end highlight and weekend
days show/hide
and some regional features (like weekend day, firstDay of the week)
would be included by regional settings.

The way I see it is, holidays are calendar events but weeks, weekends, firstDay etc are calendar properties. Think about the calendars on your OS, none of them include holidays. You have to add them yourself. That I think is what we're trying to do with datepicker. To keep the datepicker generic with minimal bloat I think calendar events should remain outside the distributed datepicker source, just my opinion.

So it's good you've added holidays to your regional settings but I doubt it'll be added into datepicker for the above reason.

Antonello Pasella

unread,
Jun 22, 2009, 8:12:37 AM6/22/09
to jQuery UI Development
It makes sense for you that beforeShowDay could be an array of
functions?
Otherwise it is impossible to have multiple functionality working
together?

Bye

Ca-Phun Ung

unread,
Jun 22, 2009, 8:36:17 AM6/22/09
to jquery...@googlegroups.com
Sorry, don't quite understand the two questions. Could you elaborate?
Why do you think beforeShowDay should be an array of functions? What
do you mean by it is possible to have multiple functionality working
together?

I'm just trying to understand the limitations you see in the
datepicker. If a strong case is made I don't see why the code could
not be improved. Help us improve it!

Thanks.

Antonello Pasella

unread,
Jun 22, 2009, 11:16:29 AM6/22/09
to jQuery UI Development
Sorry :D I'm not so good in english

I'm thinking a situation where I release a regional setting (maybe not
official) that use beforeShowDay
but in this showcase the final programme couldn't add his own
beforeShowDay (or maybe two plugins working together adding classes to
the calendar).

I'll add a showcase soon to better explain my tought
> +http://yelotofu.com

Scott González

unread,
Jun 22, 2009, 11:24:49 AM6/22/09
to jquery...@googlegroups.com
On Mon, Jun 22, 2009 at 8:12 AM, Antonello Pasella <antonell...@gmail.com> wrote:

It makes sense for you that beforeShowDay could be an array of
functions?
Otherwise it is impossible to have multiple functionality working
together?

This should be possible in the new version of datepicker that we're working on.  When datepicker is refactored to use the widget factory, all callbacks will support multiple functions via event handlers.

Antonello Pasella

unread,
Jun 23, 2009, 6:42:10 AM6/23/09
to jQuery UI Development
Thank you to decode my "spaghetti thoughts" :D

The code is in the SVN?

Bye

Scott González

unread,
Jun 23, 2009, 7:15:09 AM6/23/09
to jquery...@googlegroups.com
There's a refactor being done in the datepacker dev branch ( http://jquery-ui.googlecode.com/svn/branches/dev/datepicker/ui/ui.datepicker.js ).  I'm not sure what's been refactored so far, but I do know that it's still in the very early stages of the refactor.  I believe Ca-Phun has been working on it, perhaps he can chime in with a few more details.

Ca-Phun Ung

unread,
Jun 23, 2009, 9:59:32 AM6/23/09
to jquery...@googlegroups.com
Certainly.

The refactor is still at a very early stage. I have restructured
datepicker so it works off our widget factory. Most of the basic
functionality is working but not production ready. There are also some
major bugs that require fixing.

To minimise regressions I created a set of visual tests for all basic
functionality.

I'm currently working on porting the i18n functionality.

The refactor will include some improvents which are documented in the
planning Wiki. It will also delegate the positioning algorthm to the
new positionTo utility as this is one of the things the current
datepicker doesn't do too well.
Reply all
Reply to author
Forward
0 new messages