Skip to content

Add fractional seconds support for direct input#2910

Open
mvorisek wants to merge 7 commits intoflatpickr:masterfrom
mvorisek:allowinput_fractional_seconds
Open

Add fractional seconds support for direct input#2910
mvorisek wants to merge 7 commits intoflatpickr:masterfrom
mvorisek:allowinput_fractional_seconds

Conversation

@mvorisek
Copy link
Copy Markdown

This PR adds fractional seconds support for direct input with nanosecond resolution.

The implementation is inspired by #2870 but:

  • resolution is not limited to milliseconds
  • fractional seconds has no extra formatting token
  • format resolution is controlled by formatSecondsPrecision option, any fixed digits are supported, -1 can be used for dynamic length
  • provides well tested implementation

allowInput (direct input modification) support is well implemented and tested for typical usecases. This PR does not aim to provide UI for setting fractional seconds via flatpickr popup in order to focus on the flatpickr internal implementation. Once this PR is merged, the UI can be easily added.

Related with:

/cc @Aditya-ds-1806 @williamdes @chmln

Sponsored by my own company.

Copy link
Copy Markdown

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@PercivalFigaro
Copy link
Copy Markdown

PercivalFigaro commented Jul 17, 2023

Hello and thank you for this improvement!

Any idea when this will be merged? The use of Flatpickr in our project will be made possible only after fractional second support has been added.

@mvorisek @williamdes

Zierk59 pushed a commit to Zierk59/flatpickr that referenced this pull request May 12, 2025
# Conflicts:
#	__tests__/src/index.spec.ts
@gsimko
Copy link
Copy Markdown

gsimko commented Aug 2, 2025

@mvorisek do you plan to submit this PR?

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

Successfully merging this pull request may close these issues.

4 participants