tachybase_todo/packages/plugins/client/src/cron.ts
Dunqing 3cce8f75e5
feat: support cron field (#1421)
* feat(calendar): replace cron component with CronSet

* fix: same exported

* fix: type incorrect

* fix: locale

* feat: upgrade react-js-cron and update some text

* fix: cron path

* fix: edge case

* feat: support FixedBlock
2023-03-19 10:55:05 +08:00

17 lines
429 B
TypeScript

export const getCronLocale = (lang: string) => {
let packageName = '@nocobase/client';
let locale = null;
try {
const file = `${packageName}/src/locale`;
require.resolve(file);
locale = require(file).cron?.[lang];
} catch (error) {
try {
const file = `${packageName}/lib/locale`;
require.resolve(file);
locale = require(file).cron?.[lang];
} catch (error) {}
}
return locale;
};