update preview date

This commit is contained in:
2024-10-30 17:56:19 +07:00
parent 3114357515
commit a09785ec71
8 changed files with 347 additions and 23 deletions

View File

@@ -22,25 +22,25 @@ export const ConfigConstants: Record<
MID_DAY_BREAK_TIME_START: {
name: 'Mid Day Break Time Start',
key: 'MID_DAY_BREAK_TIME_START',
value: new Date(new Date().setHours(12, 0, 0, 0)).toISOString(),
value: new Date(new Date().setUTCHours(12, 0, 0, 0)).toISOString(),
visible: true,
},
MID_DAY_BREAK_TIME_END: {
name: 'Mid Day Break Time End',
key: 'MID_DAY_BREAK_TIME_END',
value: new Date(new Date().setHours(13, 0, 0, 0)).toISOString(),
value: new Date(new Date().setUTCHours(13, 0, 0, 0)).toISOString(),
visible: true,
},
SLOT_START_TIME: {
name: 'Slot Start Time',
key: 'SLOT_START_TIME',
value: new Date(new Date().setHours(8, 0, 0, 0)).toISOString(),
value: new Date(new Date().setUTCHours(8, 0, 0, 0)).toISOString(),
visible: true,
},
SLOT_END_TIME: {
name: 'Slot End Time',
key: 'SLOT_END_TIME',
value: new Date(new Date().setHours(22, 0, 0, 0)).toISOString(),
value: new Date(new Date().setUTCHours(22, 0, 0, 0)).toISOString(),
visible: true,
},
}

View File

@@ -32,6 +32,9 @@ export class AppConfigService implements OnModuleInit {
where: { key },
})
}
async getConfigValue(key: string) {
return (await this.getConfig(key))?.value
}
async getVisibleConfigs() {
return await this.prisma.config.findMany({