question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DatePicker & TimeInput expose incorrect FormData.

See original GitHub issue

What package has an issue

@mantine/dates

Describe the bug

When trying to use Mantine Date inputs with a framework like Remix which favours sending the pure HTML Form Data to the server to be processed, DatePicker and TimeInput do not expose the correct values.

DatePicker sends the formatted Date which is seen in the input field ont he presentation side, and TimeInput only sends the hours.

Ideally the .toDateString(), .toTimeString() or even .toISOString should be returned.

What version of @mantine/hooks page do you have in package.json?

5.5.2

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/mantine-date-form-values-lpl7lw

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

The input field should not have it’s value set to the formatted date/time, instead there should be a shadow input field showing the presentation data.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rtivitalcommented, Oct 25, 2022

The issue is fixed, it will be available with 6.0 release with dates package revamp

0reactions
ErnieBernie10commented, Nov 28, 2022

Awesome. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Date Picker it putting the wrong date into form data - Jotform
I have a form that I am using the date picker field to have people provide their date of birth. When they put...
Read more >
JQuery datepicker pre-populated in wrong format
When the page loads the startDate and endDate text boxes: "Fri Mar 14 13:54:08 WST 2014" but should be in "dd/mm/yy" format. On...
Read more >
jQuery datepicker adds wrong dateformat ('jj') [#2856256]
Problem /Motivation When using better exposed filters on a Date field on D8 (in this case Drupal core 8.2.6 ) and using the...
Read more >
DatePicker - Mantine
dateParser function should always return Date object. If parsed date is invalid when input is blurred value will be restored to last valid...
Read more >
What is wrong with my JQuery UI datepicker option code?
I have an AJAX view using Views 3 and Better Exposed Filters (and therefore jQuery UI datepicker). One of the exposed filters is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found