leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.66k stars 659 forks source link

Relative date for noUiSlider #1153

Closed mmarienko closed 3 years ago

mmarienko commented 3 years ago

Hello, i faced the issue of implementing a relative date in noUiSlider. I didn't find any suitable examples on the site or anywhere else and started solving the problem myself.

Solution: https://gist.github.com/mmarienko/07de50a6811c4f35c665cbc47a689c44 Demo: https://jsfiddle.net/mmarienko/kvj6h3pw/12/

I will be glad if you add this solution to the site in the tab "Examples".

PS: works with all languages of the world, just replace value in Intl.RelativeTimeFormat('en').

mmarienko commented 3 years ago

Why you don't add this example?

leongersen commented 3 years ago

I appreciate the suggestion, but this new example shows how to format a date, and doesn't change anything to the slider integration. Replacing the dated (ha!) date formatting code in the example would be good, though.

mmarienko commented 3 years ago

I appreciate the suggestion, but this new example shows how to format a date, and doesn't change anything to the slider integration. Replacing the dated (ha!) date formatting code in the example would be good, though.

Well, after all, your example and this one are a little different and are used for different goals. I will be glad to somehow help the project.

leongersen commented 3 years ago

I've update the dates example.

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.