Skip to content

Commit 57f944f

Browse files
committed
Fix New Zealand daylight saving time format to pass hasFormat.
1 parent 57fbbf8 commit 57f944f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Carbon/Traits/Options.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ trait Options
9696
'v' => '([0-9]{1,3})',
9797
'e' => '([a-zA-Z]{1,5})|([a-zA-Z]*\\/[a-zA-Z]*)',
9898
'I' => '(0|1)',
99-
'O' => '([+-](1[012]|0[0-9])[0134][05])',
100-
'P' => '([+-](1[012]|0[0-9]):[0134][05])',
101-
'p' => '(Z|[+-](1[012]|0[0-9]):[0134][05])',
99+
'O' => '([+-](1[0123]|0[0-9])[0134][05])',
100+
'P' => '([+-](1[0123]|0[0-9]):[0134][05])',
101+
'p' => '(Z|[+-](1[0123]|0[0-9]):[0134][05])',
102102
'T' => '([a-zA-Z]{1,5})',
103103
'Z' => '(-?[1-5]?[0-9]{1,4})',
104104
'U' => '([0-9]*)',

tests/Carbon/IsTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,9 @@ public function testHasFormat()
904904
$this->assertFalse(Carbon::hasFormat('1975-05-01', 'Y-*-d'));
905905

906906
$this->assertTrue(Carbon::hasFormat('2012-12-04 22:59.32130', 'Y-m-d H:s.vi'));
907+
908+
// New Zealand Daylight time
909+
$this->assertTrue(Carbon::hasFormat('2024-03-02T00:00:00+13:00', 'Y-m-d\TH:i:sP'));
907910
}
908911

909912
public function testHasFormatWithModifiers()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy