We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intl的formatDate函数,传入参数calendar不生效,导致我的泰国时间显示不是全球通用时间,我需要传入calendar=gregory参数, 我尝试直接使用react-intl的函数是没有问题的,似乎是umi的plugin二次封装丢掉了此属性!
import { getIntl } from 'umi'; import moment from 'moment'; // intl 的locale 属性是 th-TH const intl = getIntl(); const d = moment.utc('2024-02-02 00:00:00'); const output = intl.formatDate(d.toDate(),{ year: 'numeric', month: '2-digit', day: '2-digit', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZone: 'Asia/Bangkok', calendar: 'gregory', }) // 输出是 02/02/2567 08:00:00 正常结果应该是 02/02/2567 08:00:00 // 以下是我直接使用react-intl的方式输出结果正常 import { createIntl } from 'react-intl'; const intl = createIntl({ locale:'th-TH', messages: {}, }); const output = intl.formatDate(d.toDate(),{ year: 'numeric', month: '2-digit', day: '2-digit', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZone: 'Asia/Bangkok', calendar: 'gregory', }) // 输出结果是02/02/2567 08:00:00, calendar=gregory生效结果正常。
createIntl是否应该在umi上面暴露出来,我现在需要创建全球的时区,需要createIntl函数。 但是现在函数在 @@/plugin-locale/localeExports 临时目录内,新版本umi似乎不允许引用临时目录了。该函数很有必要暴露出来。
@@/plugin-locale/localeExports
The text was updated successfully, but these errors were encountered:
由于缺乏足够的信息,我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。
Sorry, something went wrong.
No branches or pull requests
What happens?
Intl的formatDate函数,传入参数calendar不生效,导致我的泰国时间显示不是全球通用时间,我需要传入calendar=gregory参数,
我尝试直接使用react-intl的函数是没有问题的,似乎是umi的plugin二次封装丢掉了此属性!
Mini Showcase Repository(REQUIRED)
How To Reproduce
补充
createIntl是否应该在umi上面暴露出来,我现在需要创建全球的时区,需要createIntl函数。
但是现在函数在
@@/plugin-locale/localeExports
临时目录内,新版本umi似乎不允许引用临时目录了。该函数很有必要暴露出来。Context
The text was updated successfully, but these errors were encountered: