-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
[REF] [PHP8.1] Replace usage of smarty's date_filter to ensure we don't call s… #23800
Conversation
(Standard links)
|
@@ -369,7 +369,7 @@ public static function customFormat($dateString, $format = NULL, $dateParts = NU | |||
|
|||
$hour24 = (int) substr($dateString, 11, 2); | |||
$minute = (int) substr($dateString, 14, 2); | |||
$second = (int) substr($dateString, 16, 2); | |||
$second = (int) substr($dateString, 17, 2); |
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.
this was only just added in the rc - if it is wrong then we should change this line in the rc
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.
(note the passive voice - had it been correct I could have said 'I added it' but since it seems It might be wrong.....)
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 wouldn't have noticed in my testing since the import wouldn't hit that line but yes it seems like it should be 17.
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.
You could have said 'it was not noticed' :-)
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.
Hehe. Yes one could have said that.
@@ -127,7 +127,7 @@ | |||
{/if} | |||
{else} | |||
<div class="label">{$form.start_date.label}</div> | |||
<div class="content">{$start_date_display|date_format}</div> | |||
<div class="content">{$start_date_display|crmDate}</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.
I'm not sure about this one. Without a format string these give different formats, which is probably system-dependent. On my test site I get something like Jan 2, 2021
for date_format, and January 2nd, 2021 12:13 PM
for crmDate.
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.
ok I have added the default format from date_format plugin to keep this the same
{if $event.end_date|date_format:"%Y%m%d" == $event.start_date|date_format:"%Y%m%d"} | ||
{$event.end_date|date_format:"%I:%M %p"} | ||
{if $event.end_date|crmDate:"%Y%m%d" == $event.start_date|crmDate:"%Y%m%d"} | ||
{$event.end_date|crmDate:"%I:%M %p"} |
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.
This is also slightly different, e.g. 12:13 PM
vs 12:13 pm
. But I don't think that would be confusing, and it's unlikely people have automated scripts that are parsing this or something.
e5e7035
to
0609423
Compare
…trftime which is deprecated in php8.1 Ensure start date format is the same
0609423
to
fc6f60f
Compare
…trftime which is deprecated in php8.1
Overview
This aims to eliminate from CiviCRM's code calls that generate calls to strftime by replacing the date_modifier calls with crmDate which handles similar sort of thing without the deprecated function
Before
Smarty Date Modifier used in these places
After
CiviCRM's date modifier is used
ping @totten @demeritcowboy