From 4ad44f73d7130ac3552c23ef7f00b69cda7f40d7 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 14 Nov 2024 13:40:47 +0000 Subject: [PATCH] - Fixed month() and days() format which were prepending zero ; adjusted to make it's behaviour like MySQL method --- src/Adapter/SQLite.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Adapter/SQLite.php b/src/Adapter/SQLite.php index bf2588d..30bb402 100644 --- a/src/Adapter/SQLite.php +++ b/src/Adapter/SQLite.php @@ -191,8 +191,8 @@ class SQLite implements AdapterInterface, MigrateInterface, SqlAdapterInterface return (int) in_array($string, explode(',', $string_list)); }, 2); - $pdo->sqliteCreateFunction('day', fn($date) => ( new \DateTime($date) )->format('d'), 1); - $pdo->sqliteCreateFunction('month', fn($date) => ( new \DateTime($date) )->format('m'), 1); + $pdo->sqliteCreateFunction('day', fn($date) => ( new \DateTime($date) )->format('j'), 1); + $pdo->sqliteCreateFunction('month', fn($date) => ( new \DateTime($date) )->format('n'), 1); $pdo->sqliteCreateFunction('year', fn($date) => ( new \DateTime($date) )->format('Y'), 1); }