Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix changing text and jumping caret in PSM's date input #6184

Merged
merged 1 commit into from Dec 10, 2015

Conversation

kevinansfield
Copy link
Contributor

refs #5777

  • adds new gh-datetime-input that takes a one-way-bound value and formats it, only triggering the supplied update action on focus-out
  • fixes bug in PSM's setPublishedAt action if model's published_at is a Date object not a Moment object

I spent quite a while trying to adapt https://gist.github.com/rwjblue/2d7246875098d0dbb4a4 to work with a value that's formatted on the way in rather than on the way out but kept getting some odd behaviour. Went with this "cheat" workaround which should suffice for now until we get proper one-way-binding with angle components 馃槃

refs TryGhost#5777
- adds new `gh-datetime-input` that takes a one-way-bound value and formats it, only triggering the supplied `update` action on focus-out
- fixes bug in PSM's `setPublishedAt` action if model's `published_at` is a Date object not a Moment object
@kevinansfield kevinansfield changed the title Fix changing text and jumping caret in PSM's date input [WIP] Fix changing text and jumping caret in PSM's date input Dec 8, 2015
@kevinansfield
Copy link
Contributor Author

Changing to WIP, just noticed there's some odd behaviour around date validation for new posts.

@kevinansfield kevinansfield changed the title [WIP] Fix changing text and jumping caret in PSM's date input Fix changing text and jumping caret in PSM's date input Dec 8, 2015
@kevinansfield
Copy link
Contributor Author

Figured out that the bug I'm seeing is not a new one, it's due to moment's date parsing coming up with a different date than intended. The fix in this PR should be good to go as it resolves a much more frustrating issue.

@ErisDS ErisDS mentioned this pull request Dec 8, 2015
9 tasks
ErisDS added a commit that referenced this pull request Dec 10, 2015
Fix changing text and jumping caret in PSM's date input
@ErisDS ErisDS merged commit a4b3bb7 into TryGhost:master Dec 10, 2015
@ErisDS ErisDS deleted the fix-date-input branch December 10, 2015 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants