Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Datepicker doesn’t work when format string starts with ‘dd’ #1097

Closed
RastoStric opened this issue Sep 30, 2013 · 3 comments
Closed

Datepicker doesn’t work when format string starts with ‘dd’ #1097

RastoStric opened this issue Sep 30, 2013 · 3 comments

Comments

@RastoStric
Copy link

I think the datepicker doesn’t work when format string starts with ‘dd’. I have demonstrated it with a plunker based on the basic datepicker demo from github.
http://plnkr.co/edit/HWyLXo?p=preview
Try these steps:

  1. Popup and input and datepicker show correct default date – today(30 September 2013 formatted ‘dd.MM.yyyy’).
  2. Click the ‘Clear’ button and type the same string (30.09.2013)
  3. The input shows 30.09.2013 just like in the step 1 but neither the datepicker nor the bound model show anything.
    When you change formatting to something beginning with year or month (e.g. $scope.formats[1] which is 'yyyy/MM/dd') everything works fine. I tried to play with other than default angular locals (angular-locale_sk.js) but it does not seem to have impact to the above mentioned. It seems that that the directive tries to interpret the first part of the date string as the month, because when typing ’01.10.2013’ it sets 1 January 2013 regardless of the formatting set to start with 'dd'.

One more thing – I somehow cannot set an alternative text to the today button. I tried using 'current-text' attribute – see plunker – but it does not work.
Thank you.

@bekos
Copy link
Contributor

bekos commented Sep 30, 2013

@RastoStric datepicker does not do any special parsing of the date strings. You have to use your own $parser for this. You can read more at this google group post and at issue #956.

Also, the current-text etc are not part of the 0.6 version that you are using in the plunker.

Closing but if you need any more help you can report back.

@bekos bekos closed this as completed Sep 30, 2013
@RastoStric
Copy link
Author

@bekos Thank you for the prompt reaction. Sorry for a silly question but how can I find out what version is that current-text part of?

@bekos
Copy link
Contributor

bekos commented Oct 1, 2013

@RastoStric It is not part of a release yet. It is just on the latest master. You can use the snapshot file from the dist folder after you build the project locally.
Otherwise you can grab the latest build files from here: http://ci.angularjs.org/job/angularui-bootstrap/ws/dist/index.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants