MCPcopy
hub / github.com/directus/directus / parse

Method parse

api/src/database/helpers/date/dialects/sqlite.ts:4–21  ·  view source on GitHub ↗
(date: string | Date)

Source from the content-addressed store, hash-verified

2
3export class DateHelperSQLite extends DateHelper {
4 override parse(date: string | Date): string {
5 if (!date) {
6 return date;
7 }
8
9 // Date generated from NOW()
10 if (date instanceof Date) {
11 return String(date.getTime());
12 }
13
14 // Return the time as string
15 if (date.length <= 8 && date.includes(':')) {
16 return date;
17 }
18
19 // Return dates in epoch milliseconds
20 return String(new Date(date).getTime());
21 }
22
23 override fieldFlagForField(fieldType: string): string {
24 switch (fieldType) {

Callers 15

run.tsFile · 0.45
getPackageVersionFunction · 0.45
get-sdk-version.tsFile · 0.45
tryParseJsonFunction · 0.45
addFunction · 0.45
linkFunction · 0.45
buildFunction · 0.45
parseJSONFunction · 0.45
ipv6ToBytesFunction · 0.45
findFunction · 0.45
runFunction · 0.45
index.jsFile · 0.45

Calls

no outgoing calls

Tested by 4

spawnAutoCannonFunction · 0.36
setupWSFunction · 0.36
connectFunction · 0.36
requestRouterFunction · 0.36