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

Fix issues with parsing localized date/time #2600

Merged
merged 2 commits into from Mar 6, 2022

Conversation

mshibuya
Copy link
Contributor

Hello 👋
I'm a maintainer of RailsAdmin project and currently working on integrating flatpickr into that. Thank you for the hard work of publishing and maintaining this great project!

During the integration, I found some issues related to handling of localized date/time values. Please refer to the commits for details.

If there's anything I can do to get this merged please let me know, thanks!

@@ -395,7 +441,7 @@ describe("flatpickr", () => {

fp.setDate("Thu 20 October, '16");
expect(fp.input.value).toEqual(RESULT);
fp.setDate("2015-11-21 19:29:49");
fp.setDate("2015-11-21T19:29:49Z");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needed to be changed because of the change in Regex resulted in producing a warning like this: Error: Invalid date provided: 2015-11-21 19:29:49.

@chmln
Copy link
Member

chmln commented Mar 6, 2022

Amazing work, thanks @mshibuya !!

kodiakhq bot pushed a commit to carbon-design-system/carbon-for-ibm-dotcom that referenced this pull request Mar 9, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [flatpickr](https://flatpickr.js.org) ([source](https://togithub.com/chmln/flatpickr)) | [`4.6.9` -> `4.6.10`](https://renovatebot.com/diffs/npm/flatpickr/4.6.9/4.6.10) | [![age](https://badges.renovateapi.com/packages/npm/flatpickr/4.6.10/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/flatpickr/4.6.10/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/flatpickr/4.6.10/compatibility-slim/4.6.9)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/flatpickr/4.6.10/confidence-slim/4.6.9)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>chmln/flatpickr</summary>

### [`v4.6.10`](https://togithub.com/chmln/flatpickr/releases/v4.6.10)

[Compare Source](https://togithub.com/chmln/flatpickr/compare/v4.6.9...v4.6.10)

##### What's Changed

-   Support Z & GMT custom parsing by [@&#8203;bcfox](https://togithub.com/bcfox) in [flatpickr/flatpickr#2369
-   🌐 \[ar] Translate missing phrases. by [@&#8203;mohamedsabil83](https://togithub.com/mohamedsabil83) in [flatpickr/flatpickr#2370
-   fix: restrict onKeyDown listener to Flatpickr only fixes [#&#8203;1444](https://togithub.com/chmln/flatpickr/issues/1444), [#&#8203;1387](https://togithub.com/chmln/flatpickr/issues/1387) by [@&#8203;ghiscoding](https://togithub.com/ghiscoding) in [flatpickr/flatpickr#2329
-   🌐\[ko] Add missing am/pm translation by [@&#8203;darron1217](https://togithub.com/darron1217) in [flatpickr/flatpickr#2379
-   Add missing horizontal position strings to position option type by [@&#8203;danielpierre](https://togithub.com/danielpierre) in [flatpickr/flatpickr#2400
-   Support reversed ranges for minTime and maxTime by [@&#8203;MiroslavCsonka](https://togithub.com/MiroslavCsonka) in [flatpickr/flatpickr#2482
-   Fix incorrectly migrated package-lock.json by [@&#8203;andersk](https://togithub.com/andersk) in [flatpickr/flatpickr#2467
-   Compile all ES6+ syntax to ES5 by [@&#8203;andersk](https://togithub.com/andersk) in [flatpickr/flatpickr#2469
-   \[fix] apply positionElement to instance.\_positionElement when fp.set by [@&#8203;fifzteen](https://togithub.com/fifzteen) in [flatpickr/flatpickr#2466
-   Fix rangePlugin selection problems by [@&#8203;SquareBeard](https://togithub.com/SquareBeard) in [flatpickr/flatpickr#1795
-   Fix maxTime bound bug by [@&#8203;MiroslavCsonka](https://togithub.com/MiroslavCsonka) in [flatpickr/flatpickr#2483
-   Fix parseDate on relative inputs by [@&#8203;juliapath](https://togithub.com/juliapath) in [flatpickr/flatpickr#2475
-   Add range separator for Swedish locale by [@&#8203;mlonn](https://togithub.com/mlonn) in [flatpickr/flatpickr#2434
-   Update sv.ts by [@&#8203;davemccrea](https://togithub.com/davemccrea) in [flatpickr/flatpickr#2449
-   feat: add norwegian nynorsk by [@&#8203;tw15egan](https://togithub.com/tw15egan) in [flatpickr/flatpickr#2423
-   Update fi.ts by [@&#8203;davemccrea](https://togithub.com/davemccrea) in [flatpickr/flatpickr#2450
-   Eliminate memory leak caused by event listener accumulation by [@&#8203;jefrailey](https://togithub.com/jefrailey) in [flatpickr/flatpickr#2596
-   Adjusts month abbreviation and adds aria-labels for the Greek translation (i10n) by [@&#8203;delight](https://togithub.com/delight) in [flatpickr/flatpickr#2555
-   Keyboard doesn't work inside Shadow Dom by [@&#8203;mwoess](https://togithub.com/mwoess) in [flatpickr/flatpickr#2519
-   Check exsitance of years and month in scrollPlugin by [@&#8203;mojtaba-khallash](https://togithub.com/mojtaba-khallash) in [flatpickr/flatpickr#2571
-   Create ar-dz.ts locales by [@&#8203;anugrahsoft](https://togithub.com/anugrahsoft) in [flatpickr/flatpickr#2556
-   fix: `onClose` callback was returning wrong selected dates if user changed input before close. by [@&#8203;DimitrisRK](https://togithub.com/DimitrisRK) in [flatpickr/flatpickr#2541
-   Remove repeating 'onChange' trigger by [@&#8203;quis0](https://togithub.com/quis0) in [flatpickr/flatpickr#2506
-   Append to container and children no longer classed as calendar elements by [@&#8203;cmubo](https://togithub.com/cmubo) in [flatpickr/flatpickr#2500
-   Updated week day for Sunday in ms.ts by [@&#8203;izwanakhirruddin](https://togithub.com/izwanakhirruddin) in [flatpickr/flatpickr#2496
-   Add range separator to Catalan by [@&#8203;toniavanza](https://togithub.com/toniavanza) in [flatpickr/flatpickr#2495
-   Fix for calendar position on Safari by [@&#8203;octaviofernands](https://togithub.com/octaviofernands) in [flatpickr/flatpickr#2391
-   chore: replace CircleCI status badge with GitHub Actions status by [@&#8203;ghiscoding](https://togithub.com/ghiscoding) in [flatpickr/flatpickr#2384
-   monthSelect plugin: Support "range" mode by [@&#8203;rlue](https://togithub.com/rlue) in [flatpickr/flatpickr#2297
-   fix: GitHub Actions badge fix invalid url typo by [@&#8203;ghiscoding](https://togithub.com/ghiscoding) in [flatpickr/flatpickr#2597
-   add Armenian locale by [@&#8203;vakopian](https://togithub.com/vakopian) in [flatpickr/flatpickr#2604
-   Fixes confirmDate focus accessibility by [@&#8203;gustavoaz7](https://togithub.com/gustavoaz7) in [flatpickr/flatpickr#2633
-   Add 'time\_24hr: true' to Austrian locale by [@&#8203;berndy2001](https://togithub.com/berndy2001) in [flatpickr/flatpickr#2612
-   Prevent text selection on prev/next month buttons by [@&#8203;metonym](https://togithub.com/metonym) in [flatpickr/flatpickr#2603
-   Fix issues with parsing localized date/time by [@&#8203;mshibuya](https://togithub.com/mshibuya) in [flatpickr/flatpickr#2600
-   add kurdish (sorani) language by [@&#8203;swara-mohammed](https://togithub.com/swara-mohammed) in [flatpickr/flatpickr#2620
-   Fix [#&#8203;2541](https://togithub.com/chmln/flatpickr/issues/2541) breaking with altInput enabled by [@&#8203;mshibuya](https://togithub.com/mshibuya) in [flatpickr/flatpickr#2601
-   fix: handling document click after manual update  by [@&#8203;Sayan751](https://togithub.com/Sayan751) in [flatpickr/flatpickr#2419

##### New Contributors

-   [@&#8203;bcfox](https://togithub.com/bcfox) made their first contribution in [flatpickr/flatpickr#2369
-   [@&#8203;mohamedsabil83](https://togithub.com/mohamedsabil83) made their first contribution in [flatpickr/flatpickr#2370
-   [@&#8203;darron1217](https://togithub.com/darron1217) made their first contribution in [flatpickr/flatpickr#2379
-   [@&#8203;danielpierre](https://togithub.com/danielpierre) made their first contribution in [flatpickr/flatpickr#2400
-   [@&#8203;MiroslavCsonka](https://togithub.com/MiroslavCsonka) made their first contribution in [flatpickr/flatpickr#2482
-   [@&#8203;andersk](https://togithub.com/andersk) made their first contribution in [flatpickr/flatpickr#2467
-   [@&#8203;fifzteen](https://togithub.com/fifzteen) made their first contribution in [flatpickr/flatpickr#2466
-   [@&#8203;juliapath](https://togithub.com/juliapath) made their first contribution in [flatpickr/flatpickr#2475
-   [@&#8203;mlonn](https://togithub.com/mlonn) made their first contribution in [flatpickr/flatpickr#2434
-   [@&#8203;davemccrea](https://togithub.com/davemccrea) made their first contribution in [flatpickr/flatpickr#2449
-   [@&#8203;tw15egan](https://togithub.com/tw15egan) made their first contribution in [flatpickr/flatpickr#2423
-   [@&#8203;jefrailey](https://togithub.com/jefrailey) made their first contribution in [flatpickr/flatpickr#2596
-   [@&#8203;delight](https://togithub.com/delight) made their first contribution in [flatpickr/flatpickr#2555
-   [@&#8203;mwoess](https://togithub.com/mwoess) made their first contribution in [flatpickr/flatpickr#2519
-   [@&#8203;mojtaba-khallash](https://togithub.com/mojtaba-khallash) made their first contribution in [flatpickr/flatpickr#2571
-   [@&#8203;anugrahsoft](https://togithub.com/anugrahsoft) made their first contribution in [flatpickr/flatpickr#2556
-   [@&#8203;DimitrisRK](https://togithub.com/DimitrisRK) made their first contribution in [flatpickr/flatpickr#2541
-   [@&#8203;quis0](https://togithub.com/quis0) made their first contribution in [flatpickr/flatpickr#2506
-   [@&#8203;cmubo](https://togithub.com/cmubo) made their first contribution in [flatpickr/flatpickr#2500
-   [@&#8203;izwanakhirruddin](https://togithub.com/izwanakhirruddin) made their first contribution in [flatpickr/flatpickr#2496
-   [@&#8203;toniavanza](https://togithub.com/toniavanza) made their first contribution in [flatpickr/flatpickr#2495
-   [@&#8203;octaviofernands](https://togithub.com/octaviofernands) made their first contribution in [flatpickr/flatpickr#2391
-   [@&#8203;vakopian](https://togithub.com/vakopian) made their first contribution in [flatpickr/flatpickr#2604
-   [@&#8203;gustavoaz7](https://togithub.com/gustavoaz7) made their first contribution in [flatpickr/flatpickr#2633
-   [@&#8203;berndy2001](https://togithub.com/berndy2001) made their first contribution in [flatpickr/flatpickr#2612
-   [@&#8203;metonym](https://togithub.com/metonym) made their first contribution in [flatpickr/flatpickr#2603
-   [@&#8203;mshibuya](https://togithub.com/mshibuya) made their first contribution in [flatpickr/flatpickr#2600
-   [@&#8203;swara-mohammed](https://togithub.com/swara-mohammed) made their first contribution in [flatpickr/flatpickr#2620
-   [@&#8203;Sayan751](https://togithub.com/Sayan751) made their first contribution in [flatpickr/flatpickr#2419

**Full Changelog**: flatpickr/flatpickr@v4.6.9...v4.6.10

</details>

---

### Configuration

📅 **Schedule**: "every weekend" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/carbon-design-system/carbon-for-ibm-dotcom).
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.

None yet

2 participants