Skip to content

Commit

Permalink
[REF] Fix Test fails on import by ensuring that Month Abberviations a…
Browse files Browse the repository at this point in the history
…re formatted based on the first of each month
  • Loading branch information
seamuslee001 committed Jul 31, 2022
1 parent 7bf0c13 commit 5c9843d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions CRM/Utils/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,18 @@ public static function &getAbbrMonthNames($month = FALSE) {
if (empty(\Civi::$statics[__CLASS__][$key])) {
$intl_formatter = IntlDateFormatter::create(CRM_Core_I18n::getLocale(), IntlDateFormatter::MEDIUM, IntlDateFormatter::MEDIUM, NULL, IntlDateFormatter::GREGORIAN, 'MMM');
\Civi::$statics[__CLASS__][$key] = [
1 => $intl_formatter->format(strtotime('January')),
2 => $intl_formatter->format(strtotime('February')),
3 => $intl_formatter->format(strtotime('March')),
4 => $intl_formatter->format(strtotime('April')),
5 => $intl_formatter->format(strtotime('May')),
6 => $intl_formatter->format(strtotime('June')),
7 => $intl_formatter->format(strtotime('July')),
8 => $intl_formatter->format(strtotime('August')),
9 => $intl_formatter->format(strtotime('September')),
10 => $intl_formatter->format(strtotime('October')),
11 => $intl_formatter->format(strtotime('November')),
12 => $intl_formatter->format(strtotime('December')),
1 => $intl_formatter->format(strtotime('1 January')),
2 => $intl_formatter->format(strtotime('1 February')),
3 => $intl_formatter->format(strtotime('1 March')),
4 => $intl_formatter->format(strtotime('1 April')),
5 => $intl_formatter->format(strtotime('1 May')),
6 => $intl_formatter->format(strtotime('1 June')),
7 => $intl_formatter->format(strtotime('1 July')),
8 => $intl_formatter->format(strtotime('1 August')),
9 => $intl_formatter->format(strtotime('1 September')),
10 => $intl_formatter->format(strtotime('1 October')),
11 => $intl_formatter->format(strtotime('1 November')),
12 => $intl_formatter->format(strtotime('1 December')),
];
}
if ($month) {
Expand Down

0 comments on commit 5c9843d

Please sign in to comment.