Submitted by Karl on Sun, 09/10/2006 - 15:10.
With the upcoming release of Dojo 0.4.0 approaching ever so quickly, an updated version of DatePicker has been released. Over the past few months many people have been crying out for new features for dojo.widget.DatePicker. Over the past 2 months, these cries have been met with more and more improvemnets. The most recent one being i18n support for the text displayed in DatePicker. This was a great achievement and made the DatePicker that much more fiendly for people around the world to use. With that being said, lets get on with the new and improved DatePicker.
The advantages of the new DatePicker are quite numerous. You, the community. have asked for a lot of nice features, and here is our response. You asked for a "startOnMonday", we give you the ability to start the week with
any day. You can either let Dojo decide this for you, or specify weekStartsOn=0-6 (0 being Sunday ... 6 being Saturday). Then you asked for a way to have 2 DatePickers work together... "I don't want the user to be able to pick any dates in DP2 unless they are greater than DP1's value." Done, I give you startDate="YYYY-mm-dd" and endDate="YYYY-mm-dd". As you may have guessed, this limits the user to only picking dates that are greater than startDate or less than endDate. This feature is inclusive, if you pick the 1st of January 2005, that date will be available for selection, you are providing a range of available dates for the user to choose from. You asked "why can't I just show 28 days in February... why the extra 14 days...", we give you adjustWeeks and displayWeeks. If you set adjustWeeks=true, your calendar will display only enough weeks to display the current month, and if you set displayWeeks=X, DatePicker will only show X weeks. This update also includes staticDisplay, which prevents a user from changing the displayed month.
The other big change with DatePicker is that storedDate is going away. It has been deprecated and replaced by "date" which is a much more intuitive name. If you pass date="YYYY-mm-dd" (RFC 3339 Format) via markup, your DatePicker will default to that date. The entire dojo.widget.DatePicker.util.* has been removed and replaced with features from dojo.date.*. With all these changes, now DropDownDatePicker will automatically start at the date entered in the inputNode if you click the dropdown button. Well with all that being said, here are some screen shots to show off a few of the features in action.
This shot shows how the month would look if Friday was the first day of the week.

Here is a 3 week display, created by setting displayWeeks="3" in the markup.

A shot of a calendar with a very narroow range of available dates.

And one last one, showing how September looks on a paper calendar (no excess weeks)

As always, if there are any suggestions, let us hear em! And if you happen to find a bug, let me know so we can get it fixed right away! I would love to hear what the users think of this change.
Per user feedback: I want to know what you, the users think... should DatePicker handled the "weekStartsOn" feature as 0=Sunday and 6=Saturday or as 0=Monday and 6 = Sunday? If you have an opinion either way, or could care less, your feedback is beneficial here! Thanks again for all the great feedback on the new DatePicker!
Update:
Just so you dont have to read all the comments to see the entire update to DatePicker. Users can now assign a filter function to isDisabledDate="myFunction" and as long as you define myFunction to return TRUE for the dates you want disabled, it will work. I have also updated the UI, now you can selected any date on the display without the fear of it switching months on you, and along those same lines, the controls now hide/show if they are needed... Now DatePicker and DropdownDatePicker will not initialize with a "selectedDate" hlighted unless you explicitely declare one via date="....".
That covers this update, There will only be bugfixes now on DatePicker until after 0.4 gets released.
Simply Awesome... Mike
Karl, I've been using the
Why do the month change
Someone recently asked why
What I'm missing is the
I'm still working on it ;)
Is there a way to only allow
Great work so far. Disabling
Hi, can i know the location
Bhaskar:
Great Work. It's starting to
You pose a valid point,
Is there a way i can pick
In the new
It currently isnt possible,
Diego, Interesting idea,
"I want to know what you,
Well some bad news, the
ok, So I messed up my
Hi. The date picker looks
Hi James, with the
Karl, thanks for the
Well you didnt miss the
Hi, (this isn't the right
I would love a date
Matt, Can you show me an
Just a follow up... James,
Karl, The
Woops, that is a typo on my
I've just started to look at
Ed, The onSetDate event
re: up/dn vs left/right
Karl, Is it possible to add
UI minor bug: The DatePicker
code: div
Dan, I dont understand
This is an absolutely
DatePicker makes a
Ok... That definately wont
When will the 0.4 version
hi people, sorry - just
I'm sorry, what feature is
Pretty, but its not so good
Define "several" since...
Karl, the flexibility of
Do you mean for
Yeah! I was referring to the
Yes, this looks like a bug.
[...] dojo.widget: new
A way to set what month is