Skip to content

Commit 7236c4d

Browse files
Patch 1.0.3
Somehow the setTimezone update was not `setTimezone()`` as well is chainable. ```php $t = ts('previous monday 23:00', true) ->setTimezone('America/Los_Angeles'); ```
1 parent 90a4252 commit 7236c4d

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ so documentation will come after that in the very nearest time. My apologies.
5858

5959
Minimal PHP version: **8.0**
6060

61-
Current framework version: **1.0.0**
61+
Current framework version: **1.0.3**
6262
```shell
63-
composer require spaf/simputils "~1"
63+
composer require spaf/simputils "^1"
6464
```
6565

6666
Keep in mind that the library development suppose to follow the semantic versioning,

src/PHP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static function frameworkDir() {
106106
*/
107107
public static function simpUtilsVersion(): Version|string {
108108
$class = static::redef(Version::class);
109-
return new $class('1.0.2', 'SimpUtils');
109+
return new $class('1.0.3', 'SimpUtils');
110110
}
111111

112112
/**

src/models/DateTime.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ public function setTimezone($timezone): static {
163163
if (is_string($timezone)) {
164164
$timezone = new $class_tz($timezone);
165165
}
166+
if (empty($timezone)) {
167+
$timezone = 'UTC';
168+
}
166169
return parent::setTimezone($timezone);
167170
}
168171

0 commit comments

Comments
 (0)