schema update: change from timestamp to date
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import * as Item from "$lib/components/ui/item/index.js";
|
import * as Item from "$lib/components/ui/item/index.js";
|
||||||
import { CalendarDate, parseAbsolute } from "@internationalized/date";
|
import { CalendarDate, parseDate } from "@internationalized/date";
|
||||||
|
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
import { formatDate } from "$lib/date.ts";
|
import { formatDate } from "$lib/date.ts";
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
const formattedDate = formatDate(entry.date);
|
const formattedDate = formatDate(entry.date);
|
||||||
|
|
||||||
function select() { value = parseAbsolute(entry.date) }
|
function select() { value = parseDate(entry.date) }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button class="border border-white/30 rounded-xl w-full hover:brightness-80 transition-all mb-3" onclick={select}>
|
<button class="border border-white/30 rounded-xl w-full hover:brightness-80 transition-all mb-3" onclick={select}>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { text, integer, pgTable, json, timestamp } from "drizzle-orm/pg-core";
|
import { text, integer, pgTable, json, date } from "drizzle-orm/pg-core";
|
||||||
|
|
||||||
export const entryTable = pgTable("entries", {
|
export const entryTable = pgTable("entries", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity(),
|
id: integer().primaryKey().generatedAlwaysAsIdentity(),
|
||||||
date: timestamp({ mode: 'date', withTimezone: true }).notNull().defaultNow(),
|
date: date().notNull().defaultNow(),
|
||||||
location: json(),
|
location: json(),
|
||||||
content: text(),
|
content: text(),
|
||||||
image: text()
|
image: text()
|
||||||
|
|||||||
Reference in New Issue
Block a user