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

[TimePicker] Add views for millisecond editing #5542

Open
2 tasks done
joey-kwl opened this issue Jul 19, 2022 · 2 comments
Open
2 tasks done

[TimePicker] Add views for millisecond editing #5542

joey-kwl opened this issue Jul 19, 2022 · 2 comments
Labels
component: pickers This is the name of the generic UI component, not the React module! component: TimePicker The React component. new feature New feature or request

Comments

@joey-kwl
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I can't type/edit the millisecond part
image

<TimePicker
	label="End"
	ampm={false}
	disableOpenPicker={true}
	value={endTime}
	inputFormat="HH:mm:ss.SSS"
	onChange={e => {
		console.log(e?.getMilliseconds())
	}}
	renderInput={(params) => <TextField {...params} />}

/>

Expected behavior 🤔

The milliseconds part should change and I should receive the milliseconds inside the onChange function

Steps to reproduce 🕹

Demo: https://codesandbox.io/s/secondstimepicker-demo-mui-x-forked-7in5bw?file=/demo.tsx

Context 🔦

I want a timepicker where you can set/get the milliseconds

Your environment 🌎

System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Memory: 5.97 GB / 15.93 GB
  Binaries:
    Node: 16.13.1 - D:\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.12.1 - D:\nodejs\npm.CMD
  Managers:
    Maven: 3.6.3 - D:\apache-maven\bin\mvn.CMD
    pip3: 21.3.1 - D:\Python\Python38\Scripts\pip3.EXE
  Utilities:
    Git: 2.21.0. - /mingw64/bin/git
  Virtualization:
    Docker: 20.10.14 - C:\Program Files\Docker\Docker\resources\bin\docker.EXE
  IDEs:
    VSCode: 1.69.1 - D:\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 4.4.23 - D:\Git\usr\bin\bash.EXE
    Go: 1.17 - D:\Go\bin\go.EXE
    Java: 11.0.13 - /c/Program Files/Java/jdk-11.0.13/bin/javac
    Perl: 5.26.2 - D:\Git\usr\bin\perl.EXE
    PHP: 7.4.30 - C:\tools\php74\php.EXE
    Python: 3.8.6 - /d/Python/Python38/python
    Ruby: 2.4.2 - D:\Ruby24-x64\bin\ruby.EXE
  Browsers:
    Chrome: 103.0.5060.114

Order ID 💳 (optional)

No response

@joey-kwl joey-kwl added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 19, 2022
@flaviendelangle
Copy link
Member

flaviendelangle commented Jul 20, 2022

Indeed, our time components only go to the second

One of the limitation is probably that the mergeDateAndTime method in the adapters only merge up to the second

https://github.com/dmtrKovalenko/date-io/blob/77f89b4859d228ed8f34c740e3defc78d52bdba1/packages/date-fns/src/date-fns-utils.ts#L384

@flaviendelangle flaviendelangle added new feature New feature or request component: pickers This is the name of the generic UI component, not the React module! component: TimePicker The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 20, 2022
@flaviendelangle flaviendelangle changed the title [TimePicker] Can't get milliseconds [TimePicker] Support millisecond editing Jul 20, 2022
@flaviendelangle
Copy link
Member

The first step would be to support the milliseconds on the new fields component
If someone wants to prepare it

For the pickers, once we are able to fallback on the field for some view (like for the hours / minutes / seconds on desktop) it should be pretty straightforward.

@LukasTy LukasTy changed the title [TimePicker] Support millisecond editing [TimePicker] Add views for millisecond editing Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! component: TimePicker The React component. new feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants