3cce8f75e5
* 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
17 lines
429 B
TypeScript
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;
|
|
};
|