-
Notifications
You must be signed in to change notification settings - Fork 846
CRM: Refactor IntlDateFormatter dependency #28909
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
Conversation
|
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 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Crm plugin:
|
| #} the date picker UI | ||
| function zeroBSCRM_task_ui_date($taskObject = array()){ | ||
|
|
||
| $html = "<div class='no-task-date'><i class='ui icon calendar outline'></i> ". __('Date','zero-bs-crm') ." </div>"; |
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.
The variable was overridden on line 769, so there's no need for us to keep it around.
As far as I can see, then it must have been used when together with an early bail out return so we'd show it as a default value but that never happens.
|
I know this is still a draft but I thought I'd see if I could replicate the issue and test the fix, however I couldn't replicate the issue. |
Thank you for taking the time @coder-karen - did you check if you have the |
|
Ah no I didn't - it is enabled. I tried to spin up a JN site with an older (pre 7.2) version of PHP since it's apparently enabled by default on PHP versions above 7.2, but if the PHP version is lower CRM won't work at all. |
I'm pretty sure it doesn't come as default and requires specific "opt-in" arguments to activate/install it (e.g.: I'm using the Jetpack Monorepo's Docker setup with PHP That being said, then |
| // dd MMMM yyyy HH:mm:ss (IntlDateFormatter - locale based date) | ||
| // (https://www.php.net/manual/en/class.intldateformatter.php) | ||
| // d F Y H:i:s (date - locale based date) | ||
| // (https://www.php.net/manual/en/function.date.php) |
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.
I think this long comment could use some rewriting. It comes across now as "instead of using date, we use date because date isn't affected by the locale issues like date is".
We used to rely on
strftimebefore migrating to the monorepo (#28314), butPHPCompatibility.FunctionUse.RemovedFunctions.strftimeDeprecatedrevealed that it has been flagged as deprecated since PHP 8.1:We chose to refactor to use
IntlDateFormatterin dc36c7a to satisfy PHPCS and be preventive in terms ofstrftimebeing removed butIntlDateFormatterrequires theintlextension.We might as well use
date()and thereby keep same system requirements as before (which then also means that my local Jetpack Docker environment doesn't throw errors anymore 😄).Proposed changes:
IntlDateFormattertodate.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Scenario 1: Create new task/event
intlextension is disabled if you want to reproduce the initial error before using this refactor)/wp-admin/admin.php?page=zbs-add-edit&action=edit&zbstype=eventabcdefg.