fix(db): fix .now variable (#2209)
This commit is contained in:
parent
6c19dad23d
commit
687f3c214d
@ -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),
|
||||||
},
|
},
|
||||||
|
@ -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),
|
||||||
|
Loading…
Reference in New Issue
Block a user