Premium Analytics: converge the duplicated date-label validators and day bounds - #52070
Open
chihsuan wants to merge 3 commits into
Open
Premium Analytics: converge the duplicated date-label validators and day bounds#52070chihsuan wants to merge 3 commits into
chihsuan wants to merge 3 commits into
Conversation
Contributor
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 6 files. Only the first 5 are listed here.
|
chihsuan
force-pushed
the
change/wooa7s-2079-dedup
branch
from
September 9, 2026 04:05
09210d3 to
9bb650f
Compare
chihsuan
marked this pull request as ready for review
September 9, 2026 06:03
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes WOOA7S-2079 (items 3, 4, 7 and part of 5; item 1 is #52064)
Proposed changes
parseExactLabel( label, labelFormat )intopackages/datetimeand route the five copies of theparse+isValid+ round-tripformatidiom through it, along with the two copies of itsnew Date( 2001, 0, 1 )reference date.toValidDayinuse-post-views.ts, which duplicated the sharedtoDaycharacter for character. Its sibling widget already imported the shared one.'00:00:00'/'23:59:59'day bounds asDAY_START_TIME/DAY_END_TIMEinstats/utils.ts, next to the three files that use them.No behavior changes, so nothing in
readme.txtand no plugin changelog entries. The only test file edited gains assertions; none was moved or weakened.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Nothing to click. This is an internal refactor with no user-visible surface, so the check is that the existing suites still pass without any assertion being edited.
jp test js packages/premium-analytics(or, scoped:PA_TEST_GROUPS=1 TZ=UTC npx jest --config=tests/jest.config.cjs packages/datetime packages/data widgets/post-views widgets/popular-days packages/widgets-toolkit), 166 suites, 1531 tests.pnpm run typecheckandpnpm run lint-changed.Date | nulltoundefinedconversion inreadRowDateand the reference-date consolidation.