Skip to content
New issue

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

日期显示英文 #17

Closed
taoyao-code opened this issue Feb 2, 2023 · 5 comments
Closed

日期显示英文 #17

taoyao-code opened this issue Feb 2, 2023 · 5 comments

Comments

@taoyao-code
Copy link

image

设置的中文,却显示英文

@iceqing
Copy link
Owner

iceqing commented Feb 2, 2023

可以贴下amis JSON的代码吗?

@taoyao-code
Copy link
Author

示例中的时间都是这种的。

@taoyao-code
Copy link
Author

taoyao-code commented Feb 3, 2023

{
  "type": "page",
  "body": {
    "type": "form",
    "debug": true,
    "api": "/amis/api/mock2/form/saveForm",
    "body": [
      {
        "type": "input-datetime",
        "name": "datetime",
        "label": "日期时间"
      }
    ]
  }
}

当前项目的示例中:
https://github.com/iceqing/react-amis-admin/blob/vite/src/pages/admin/form/Basic.tsx
image

@iceqing
Copy link
Owner

iceqing commented Feb 3, 2023

这个应该是moment包的问题,可以在App.tsx引入中文文件。

import "moment/dist/locale/zh-cn";

iceqing added a commit that referenced this issue Feb 3, 2023
@iceqing
Copy link
Owner

iceqing commented Feb 3, 2023

vite分支已修复该问题, 代码diff可以参考a205b7c

image

@iceqing iceqing closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants