Datepicker doesn't understand format "%d.%m.%Y" #111

DyaGa opened this Issue Mar 5, 2012 · 3 comments


None yet

4 participants

DyaGa commented Mar 5, 2012


The date is 04.02.2010 (February 04, 2010) but Datepicker show this as 02.04.2010 (April 02, 2010).

Here is the code from example:

<input type="text" name="date" id="ctrl_date" class="tl_text" value="04.02.2010" onfocus="Backend.getScrollOffset()"> <img src="plugins/datepicker/icon.gif" width="20" height="20" alt="" id="toggle_date" style="vertical-align:-6px">
  window.addEvent("domready", function() {
    new Picker.Date($$("#ctrl_date"), {
      titleFormat:"%B %d%o, %Y"

P.S. Sorry for my bad English.


Whilst maybe the format should work independently of it, I got %d.%m.%Y to work by changing MooTools's Locale ( to one that supports %d.%m.%Y by default, in my case 'en-GB'.


I have similar problem.
As i have found out that "format" option in this extension uses only in case the user selects the date in calendar.

The datepiker uses mootools Date.parse method to parse string with date (see In that method it is used the parsePatterns array of patterns. But I was surprised when i now: That there is no possibility to add new pattern to the beginning to this array. Only to the end of array (see Date.defineParser() method). And this array is out of the variable scope.

When datepicker runs Date.parse it skipping through the parsePatterns.
And third pattern match the our string.
But as our pattern is at the end of array it can't match our string.

That's all :*(


For me, the following workaround did the trick. It moves the newly defined date parser to the beginning of the Date.parsePatterns array:

var definedParser = Date.parsePatterns.pop();

Hope it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment