date-fns v1.17.0 Release Notes

Release Date: 2016-12-10 // over 7 years ago
  • ➕ Added

    🛠 Fixed

    • 🛠 Fix TypeScript and flow typings for isValid. See PR: #310

    • 🛠 Fix incorrect locale tests that could potentially lead to format bugs. Kudos to Mateusz Derks @ertrzyiks. See related PRs: #312, #320

    • 📚 Minor language fixes in the documentation. Thanks to Vedad Šoše @vedadsose (#314) and Asia @asia-t (#318)

    🔄 Changed

    • format now returns String('Invalid Date') if the passed date is invalid. See PR: #323

    • distanceInWords, distanceInWordsToNow, distanceInWordsStrict and format functions now check if the passed locale is valid, and fallback to English locale otherwise. See PR: #321

    • Internal: use a loop instead of Object.keys in buildFormattingTokensRegExp to improve compatibility with older browsers. See PR: #322