Skip to content

Commit 2589fa8

Browse files
Patch 1.0.4
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 7236c4d commit 2589fa8

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ 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.3**
61+
Current framework version: **1.0.4**
6262
```shell
6363
composer require spaf/simputils "^1"
6464
```

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.3', 'SimpUtils');
109+
return new $class('1.0.4', 'SimpUtils');
110110
}
111111

112112
/**

src/models/DateTime.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,14 @@ public function setTimezone($timezone): static {
160160
// property - it will be used ONLY for setting, without returning anything.
161161
// This is why return-type signature has no definition!
162162
$class_tz = PHP::redef(DateTimeZone::class);
163-
if (is_string($timezone)) {
164-
$timezone = new $class_tz($timezone);
165-
}
163+
166164
if (empty($timezone)) {
167165
$timezone = 'UTC';
168166
}
167+
168+
if (is_string($timezone)) {
169+
$timezone = new $class_tz($timezone);
170+
}
169171
return parent::setTimezone($timezone);
170172
}
171173

0 commit comments

Comments
 (0)