File tree Expand file tree Collapse file tree 4 files changed +36
-1
lines changed
Expand file tree Collapse file tree 4 files changed +36
-1
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ public function __construct()
1616 public function format ( $ Data ): string
1717 {
1818 $ Date = self ::normalizeDate ( $ Data );
19+ if ( $ Date === '' )
20+ {
21+ return '' ;
22+ }
23+
1924 return date ( $ this ->getFormat (), strtotime ( $ Date ) );
2025 }
2126}
Original file line number Diff line number Diff line change @@ -30,6 +30,36 @@ public function testFormat()
3030 $ Formatter ->format ( '23/12/2018 ' )
3131 );
3232
33+ $ this ->assertEquals (
34+ '' ,
35+ $ Formatter ->format ( '23/12 ' )
36+ );
37+
38+ $ this ->assertEquals (
39+ '' ,
40+ $ Formatter ->format ( '23/13/2018 ' )
41+ );
42+
43+ $ this ->assertEquals (
44+ '' ,
45+ $ Formatter ->format ( '13/32/2018 ' )
46+ );
47+
48+ $ this ->assertEquals (
49+ '' ,
50+ $ Formatter ->format ( '32/12/2018 ' )
51+ );
52+
53+ $ this ->assertEquals (
54+ '' ,
55+ $ Formatter ->format ( '3244/1244/20184 ' )
56+ );
57+
58+ $ this ->assertEquals (
59+ '' ,
60+ $ Formatter ->format ( '3244124420184 ' )
61+ );
62+
3363 }
3464
3565 public function testFormatWithFormat ()
Original file line number Diff line number Diff line change 11## 0.6.6
2+ * Upgraded tests to 100% coverage.
23
34## 0.6.5 2025-01-13
45* Updated phone number formatter to support international.
You can’t perform that action at this time.
0 commit comments