Skip to content

Commit

Permalink
Merge pull request #2683 from kylekatarnls/fix/issue-2679-allow-lower…
Browse files Browse the repository at this point in the history
…-macro-format-per-language-customization

Allow lowercase macro-format per-language customization
  • Loading branch information
kylekatarnls authored Oct 17, 2022
2 parents bb76b61 + 334f2df commit d61ab74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Carbon/Lang/fi.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@
'LTS' => 'HH.mm:ss',
'L' => 'D.M.YYYY',
'LL' => 'dddd D. MMMM[ta] YYYY',
'll' => 'ddd D. MMM YYYY',
'LLL' => 'D.MM. HH.mm',
'LLLL' => 'D. MMMM[ta] YYYY HH.mm',
'llll' => 'D. MMM YY HH.mm',
],
'weekdays' => ['sunnuntai', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai'],
'weekdays_short' => ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'],
Expand Down
6 changes: 5 additions & 1 deletion src/Carbon/Traits/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,10 @@ public function getIsoFormats($locale = null)
'LL' => $this->getTranslationMessage('formats.LL', $locale, 'MMMM D, YYYY'),
'LLL' => $this->getTranslationMessage('formats.LLL', $locale, 'MMMM D, YYYY h:mm A'),
'LLLL' => $this->getTranslationMessage('formats.LLLL', $locale, 'dddd, MMMM D, YYYY h:mm A'),
'l' => $this->getTranslationMessage('formats.l', $locale),
'll' => $this->getTranslationMessage('formats.ll', $locale),
'lll' => $this->getTranslationMessage('formats.lll', $locale),
'llll' => $this->getTranslationMessage('formats.llll', $locale),
];
}

Expand Down Expand Up @@ -2161,7 +2165,7 @@ public function isoFormat(string $format, ?string $originalFormat = null): strin

$input = mb_substr($format, $i);

if (preg_match('/^(LTS|LT|[Ll]{1,4})/', $input, $match)) {
if (preg_match('/^(LTS|LT|l{1,4}|L{1,4})/', $input, $match)) {
if ($formats === null) {
$formats = $this->getIsoFormats();
}
Expand Down

0 comments on commit d61ab74

Please sign in to comment.