nuxt-community / date-fns-module

Modern JavaScript date utility library - date-fns for Nuxt.js
MIT License
78 stars 8 forks source link

feat: add fallback locale #51

Closed ThibaultNocchi closed 3 years ago

ThibaultNocchi commented 3 years ago

I've added a fallbackLocale setting which allows the functions to use it if we give them an unsupported locale.

This is useful cause in the case where we support a lot of i18n locales, we tend to pass the current one to the date-fns functions. But having a unsupported locale passed to date-fns would crash it.

With this, it'll instead first check the presence of the fallbackLocale and use it if it exists.

codecov[bot] commented 3 years ago

Codecov Report

Merging #51 (6ce9a21) into master (19d47da) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #51   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           14        18    +4     
  Branches         4         6    +2     
=========================================
+ Hits            14        18    +4     
Impacted Files Coverage Δ
lib/module.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 19d47da...6ce9a21. Read the comment docs.

ThibaultNocchi commented 3 years ago

Hello,

Is this repo still looked over or not? :)

ricardogobbosouza commented 3 years ago

Hi @ThibaultNocchi I lost this PR, I will analyze

ThibaultNocchi commented 3 years ago

No problem, it happens. :)