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

ui-date loses information when using dateFormat (caused due to a bug in jquery-ui) #58

Description

@saurabhnanda

My plunker at http://plnkr.co/edit/OM1O89Aw0wi1wDgn9ul5?p=preview demonstrates the issue. Try selecting a date NOT in the current year (i.e. if you're seeing this in 2013, try selecting a date in 2014). You'll notice that the date object in the scope -- $scope.myDate -- still has 2013 as the year.

This actually happens because of how jquery-ui responds to the dateFormat setting. However, when you're in the angular world, you'd expect the following behaviour:

  • The underlying date object should always be correct and neither dateFormat, altFormat, nor ui-date-format should affect what gets stored in it
  • The above mentioned settings should affect ONLY what is displayed to the user.

Please note, using ui-date-format does NOT solve this issue. Because that causes the ui-date to accept and emit strings into the ngModel. How does one continue to have a Date object in the ngModel while changing what is displayed to the user.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions