fix(db): fix .now variable (#2209)

This commit is contained in:
Junyi 2023-07-07 18:15:29 +07:00 committed by GitHub
parent 6c19dad23d
commit 687f3c214d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -44,9 +44,6 @@ export const parseVariables = async (ctx, next) => {
return ctx.db.getFieldByPath(`${resourceName}.${fieldPath}`); return ctx.db.getFieldByPath(`${resourceName}.${fieldPath}`);
}, },
vars: { vars: {
$system: {
now: new Date().toISOString(),
},
$date: getDateVars(), $date: getDateVars(),
$user: getUser(ctx), $user: getUser(ctx),
}, },

View File

@ -267,6 +267,7 @@ const toDays = (offset: number) => {
export function getDateVars() { export function getDateVars() {
return { return {
now: new Date().toISOString(),
today: toUnit('day'), today: toUnit('day'),
yesterday: toUnit('day', -1), yesterday: toUnit('day', -1),
tomorrow: toUnit('day', 1), tomorrow: toUnit('day', 1),