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

通用参数中当Format时dateTime类型的时候如何控制时间的format? #12

Closed
ColinChen2 opened this issue Nov 14, 2019 · 2 comments
Labels
good first issue Good for newcomers

Comments

@ColinChen2
Copy link

ColinChen2 commented Nov 14, 2019

如何定义日期的输出格式,比如输出成,"YYYY/MM/DD"

在官网例子中demo
选择关于日期的配置里

"date2": {
        "title": "日期选择",
        "type": "string",
        "format": "date",
        "ui:options": {
          "format": "YYYY/MM/DD"
        }
      }
  • formRender 版本号:最新版本
  • 可复现问题的 codeSandbox 地址:官网
2.实际的效果以及期待效果或功能说明
  • 实际的效果:

    Screen Shot 2019-11-14 at 3 18 12 PM
  • 期待的效果或功能:
  1. 组件时间显示为2019/11/14
  2. data输出"date2": "2019/11/14",

BY THE WAY
通用参数中的【format】给人以迷惑,第一眼看,不知道干嘛的。参照【don't make me think】的设计原则,建议使用其他术语,比如【element】,也比较符合现在的数据抽象维度。

@FateRiddle
Copy link
Contributor

FateRiddle commented Nov 14, 2019

谢谢你的反馈,问题已经排查。form-render每周一定期发布。
关于最后一个问题,form-render遵循了JSON Schema的国际规范,使用的字段是有严格规范的。这也便于已经使用JSON Schema规范的团队无缝接入。
p.s. 定义日期显示格式的字段,format感觉更恰当吧

@tw93 tw93 added the good first issue Good for newcomers label Nov 14, 2019
@FateRiddle
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants