1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-09-16 17:46:19 +02:00

Merge branch 'master' into develop

This commit is contained in:
Gani Georgiev
2023-05-30 21:22:39 +03:00
3 changed files with 8 additions and 1 deletions

View File

@@ -30,6 +30,8 @@
- Fixed the selfupdate command not working on Windows due to missing `.exe` in the extracted binary path ([#2589](https://github.com/pocketbase/pocketbase/discussions/2589)).
- Added `int64`, `int32`, `uint`, `uint64` and `uint32` support when scanning `types.DateTime` ([#2602](https://github.com/pocketbase/pocketbase/discussions/2602))
## v0.16.3

View File

@@ -78,7 +78,7 @@ func (d *DateTime) Scan(value any) error {
d.t = v.Time()
case time.Time:
d.t = v
case int:
case int, int64, int32, uint, uint64, uint32:
d.t = cast.ToTime(v)
case string:
if v == "" {

View File

@@ -32,6 +32,11 @@ func TestParseDateTime(t *testing.T) {
{nowDateTime, nowStr},
{nowTime, nowStr},
{1641024040, "2022-01-01 08:00:40.000Z"},
{int32(1641024040), "2022-01-01 08:00:40.000Z"},
{int64(1641024040), "2022-01-01 08:00:40.000Z"},
{uint(1641024040), "2022-01-01 08:00:40.000Z"},
{uint64(1641024040), "2022-01-01 08:00:40.000Z"},
{uint32(1641024040), "2022-01-01 08:00:40.000Z"},
{"2022-01-01 11:23:45.678", "2022-01-01 11:23:45.678Z"},
}