Skip to content

Commit

Permalink
fix #1930 FrozenTime::setToStringFormat 書式変更
Browse files Browse the repository at this point in the history
  • Loading branch information
seto1 committed May 17, 2023
1 parent 06c3751 commit 2f49612
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/baser-core/src/Model/Table/AppTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function addPrefix($table)
public function initialize(array $config): void
{
parent::initialize($config);
FrozenTime::setToStringFormat('yyyy/MM/dd HH:mm:ss');
FrozenTime::setToStringFormat('yyyy-MM-dd HH:mm:ss');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public function testInitialize()
$Permission = new TablePermissionsTable();

$this->assertMatchesRegularExpression(
// yyyy/MM/dd HH:mm:ssのパターン
'{^[0-9]{4}/(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])\s([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$}',
// yyyy-MM-dd HH:mm:ssのパターン
'{^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])\s([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$}',
$Permission->find()->first()->created->__toString()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ public function updatePublishDateDataProvider()
'self_publish_end' => new FrozenTime('2022/12/30 00:00:00'),
],
[
'publish_begin' => '2022/12/01 00:00:00',
'publish_end' => '2022/12/30 00:00:00',
'publish_begin' => '2022-12-01 00:00:00',
'publish_end' => '2022-12-30 00:00:00',
]
],
// nullになる場合
Expand Down

0 comments on commit 2f49612

Please sign in to comment.