-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Chrome: Adding the post date picker to schedule posts #841
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
eb8b1d9
Chrome: Adding the post date picker to schedule posts
youknowriad 3568362
Post Schedule: Include wp.date script and localize the datepicker
youknowriad 9625759
Post Schedule: Depending on the timezone show/hide the AM/PM selector
youknowriad 45e1913
WP Date: Fix PHPCS test
youknowriad 8189cb7
WP Date: Fix JS unit tests
youknowriad 27fd6c9
Post Schedule: Prefill the post schedule modal
youknowriad cce5fdb
Move date picker styles into PostSchedule stylesheet
aduth b7e0954
Chrome: Check more accurately the 12 hour time
youknowriad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Post Schedule: Depending on the timezone show/hide the AM/PM selector
- Loading branch information
commit 9625759d8d563157281d0113a15ff4512f556639
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be inaccurate because it's possible to escape characters in the format. In other words,
'H:i:s \a\w\e\s\o\m\e'is not twelve hour time, but this logic would treat it as though it were.Also, it could be simpler to force to lower/upper and test index of the one instance of 'a'/'A'.
Accounting for escaping could be tricky, particularly since JavaScript doesn't support lookbehind regular expression patterns. Dunno if there's a better way, but "flipping" the string and doing a look ahead is one option:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even this solution is not perfect because this
\\\\\ais a 12 hour time but the test returnsfalseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is the right test
/a(?!\\)/i.test( '\\\\\\\\a'.replace(/\\\\/g).split( '' ).reverse().join( '' ) )