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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#511 Fix wrong current month showing on Membership Dashboard #13072

Merged

Conversation

aydun
Copy link
Contributor

@aydun aydun commented Nov 8, 2018

Overview

Correct the current month on the Membership Dashboard summary.

Before

screenshot from 2018-11-08 12-48-54

Current month is wrong

After

screenshot from 2018-11-08 12-48-22

Current month is right

Technical Details

Nothing much

Comments

https://lab.civicrm.org/dev/core/issues/511

@civibot
Copy link

civibot bot commented Nov 8, 2018

(Standard links)

@civibot civibot bot added the master label Nov 8, 2018
* the $format-formatted $date
*/
public static function customFormatTs($timestamp, $format = NULL, $dateParts = NULL) {
return CRM_Utils_Date::customFormat(date("Y-m-d H:i:s", $timestamp) , $format, $dateParts);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, the test is failing due to the extra space after ). Can you try removing that and ask jenkin to retest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urgh! Stray spaces removed.

@jitendrapurohit
Copy link
Contributor

Not sure if we are in need of an additional function here. Same could be handled in Dashboard.php by replacing the tpl variable assignment by -

$this->assign('month', CRM_Utils_Date::customFormat(date('Y-m-d', $monthStartTs), '%B'));

But if this new function seems to be a good usage in future - Happy for this to merge as it fixes the main issue on Membership page as expected 👍

@aydun aydun force-pushed the core511_membership_dashboard branch from d22953b to 4b5f2d8 Compare November 8, 2018 13:59
@aydun
Copy link
Contributor Author

aydun commented Nov 8, 2018

Agreed, it could be handled directly in the assign but the function seemed like it might be useful elsewhere.

@eileenmcnaughton
Copy link
Contributor

@aydun don't suppose we could get a test on that new function?

Remove stray dash after Last Month name
Add tests for new CRM_Utils_Date::customFormatTs() and existing CRM_Utils_Date::customFormat()

dev/core#511
@aydun aydun force-pushed the core511_membership_dashboard branch from 4b5f2d8 to d2f262d Compare November 8, 2018 22:07
@aydun
Copy link
Contributor Author

aydun commented Nov 8, 2018

@eileenmcnaughton just for you :-) With a bonus test for the existing customFormat() fn

@eileenmcnaughton
Copy link
Contributor

@aydun so I requested a test well after you should have stopped working & you turned it around within an hour!!??!!??!!

Merge on pass I say!!

@eileenmcnaughton eileenmcnaughton merged commit 9467f0c into civicrm:master Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants