Git Product home page Git Product logo

Comments (18)

afc163 avatar afc163 commented on June 23, 2024 1

原来 format 已经支持 function 类型了,那文档需要补一下。

from ant-design.

zombieJ avatar zombieJ commented on June 23, 2024 1

不然选了 9点 ~ 8 点,再选 7点 ~ 8点,下拉框会出现如下情况的bug。

录个 gif 看看?

from ant-design.

github-actions avatar github-actions commented on June 23, 2024

Hello @afc163. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @afc163,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

giphy

from ant-design.

zombieJ avatar zombieJ commented on June 23, 2024

当日次日 这个是不能决定的。
05:00 ~ 06:00 到底是 当日 05:00 ~ 当日 06:00 还是 当日 05:00 ~ 次日 06:00

这里隐含了业务信息 “在 24 小时内”,或者“某个时间点开始算次日”。

from ant-design.

afc163 avatar afc163 commented on June 23, 2024

对,这个得靠选。

format 和这个没关系,本来就应该支持两个分开定制。

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

@zombieJ 大佬,我建议加个组件,这种场景还是蛮多的。#49364

  <TimePicker.CrossRangePicker
    value={{
      // 标识当前是否为跨日时段,如果是,`end` 的时间标识次日的时间点;如果否,则 `[start, end]` 表示为同一天的时段。
      crossDate: boolean,
      // 开始时间点
      startTime: '22:00:00',
      // 结束时间点
      endTime: '6:00:00',
    }}
  />

from ant-design.

zombieJ avatar zombieJ commented on June 23, 2024

这个意思?

https://stackblitz.com/edit/react-kdkub3-crr1vs?file=demo.tsx

from ant-design.

zombieJ avatar zombieJ commented on June 23, 2024

@zombieJ 大佬,我建议加个组件,这种场景还是蛮多的。#49364

这个就是我上面提到的,05:00 ~ 06:00 这个 06:00 到底算当日还是算次日,这个是业务逻辑决定的。我可以是 24 小时内,也可以是规定 5 点之后所有时间都算次日。

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

这个意思?

https://stackblitz.com/edit/react-kdkub3-crr1vs?file=demo.tsx

@zombieJ 我理解你的意思,相当于开始时间大于结束时间则表示跨日。假设业务要求时间段长度必须在24小时内,这样就是可以接受的。

但是 format 是不是得支持返回数组分别设置开始和结束的输入框内容, 不然选了 9点 ~ 8 点,再选 7点 ~ 8点,下拉框会出现如下情况的bug。

image

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

这个意思?

https://stackblitz.com/edit/react-kdkub3-crr1vs?file=demo.tsx

@zombieJ @afc163 还是2个问题没有解决:

  1. 目前只满足业务时间段长度不能超过24小时的场景,超过24小时的长度时间段选择没法支持;
  2. 还是从用户体验角度来看,UI语义没有那么明确,这个东西对用户来讲,得要试一下才会发现可以选择跨日的。

所以我的提议方案 #49364 要不要再考虑考虑。。。感谢~

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

这个意思?
https://stackblitz.com/edit/react-kdkub3-crr1vs?file=demo.tsx

@zombieJ 我理解你的意思,相当于开始时间大于结束时间则表示跨日。假设业务要求时间段长度必须在24小时内,这样就是可以接受的。

但是 format 是不是得支持返回数组分别设置开始和结束的输入框内容, 不然选了 9点 ~ 8 点,再选 7点 ~ 8点,下拉框会出现如下情况的bug。

image

@zombieJ 问题好像出在 onCalendarChange 不是选择时间实时回调的。。有实时回调的函数吗?

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

不然选了 9点 ~ 8 点,再选 7点 ~ 8点,下拉框会出现如下情况的bug。

录个 gif 看看?

@zombieJ 了解了,V5没问题。我本地用的V4才会复现。那请问V4除了升级到V5有解决办法吗? https://stackblitz.com/edit/react-kdkub3-ahupgs?file=demo.tsx

2024-06-13.15.26.53.mov

from ant-design.

zombieJ avatar zombieJ commented on June 23, 2024

v5 重写了 rc-picker,v4 已经过了维护期了。可以考虑升级,或者自己封装 rc-picker

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

v5 重写了 rc-picker,v4 已经过了维护期了。可以考虑升级,或者自己封装 rc-picker

@zombieJ 这就难过了, V4给你们提个feature,支持 下拉面板选择时间实时回调 可以吗? 成本相对最低。。

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

@afc163 @zombieJ 如果 V4 format 支持函数,然后函数的入参 加个第二个参数,info.range = 'start | end' 来区分format来源也是可以实现期望的效果的。看行不?

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

@zombieJ 我看你们 format 内部 支持函数,也支持函数数组,我理解是想分别渲染前后输入框内容的,,,但范围时间选择器输入框渲染时,你们只取第一个函数来处理渲染。是不是有bug。
image
image
image

from ant-design.

Flcwl avatar Flcwl commented on June 23, 2024

果然,format 目前不支持数组渲染前后输入框。 难怪 afc163 要另起这个 issue

image

from ant-design.

afc163 avatar afc163 commented on June 23, 2024

@Flcwl 确实可以支持一下,来个 PR?

from ant-design.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.