mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] format
This commit is contained in:
parent
a1343184da
commit
8ef2f62c53
1 changed files with 2 additions and 3 deletions
|
@ -21,8 +21,7 @@ export function hasPrimaryKey(column: DBColumn) {
|
|||
|
||||
// Taken from:
|
||||
// https://stackoverflow.com/questions/52869695/check-if-a-date-string-is-in-iso-and-utc-format
|
||||
const isISODateString = (str: string) =>
|
||||
/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(str);
|
||||
const isISODateString = (str: string) => /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(str);
|
||||
|
||||
const dateType = customType<{ data: Date; driverData: string }>({
|
||||
dataType() {
|
||||
|
@ -32,7 +31,7 @@ const dateType = customType<{ data: Date; driverData: string }>({
|
|||
return value.toISOString();
|
||||
},
|
||||
fromDriver(value) {
|
||||
if(!isISODateString(value)) {
|
||||
if (!isISODateString(value)) {
|
||||
// values saved using CURRENT_TIMESTAMP are not valid ISO strings
|
||||
// but *are* in UTC, so append the UTC zone.
|
||||
value += 'Z';
|
||||
|
|
Loading…
Reference in a new issue