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(deps): update date-fns to v3 (major) #633

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 9, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
date-fns 2.30.0 -> 3.6.0 age adoption passing confidence
date-fns-tz 2.0.1 -> 3.1.3 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the warning logs for more information.


Release Notes

date-fns/date-fns (date-fns)

v3.6.0

Compare Source

On this release worked @​kossnocorp and @​world1dan. Also, thanks to @​seated for sponsoring me.

Fixed
Added

v3.5.0

Compare Source

Kudos to @​fturmel, @​kossnocorp, @​makstyle119, @​tan75, @​marcreichel, @​tareknatsheh and @​audunru for working on the release. Also, thanks to @​seated for sponsoring me.

Fixed
Added
  • Added the constructNow function that creates the current date using the passed reference date's constructor.

v3.4.0

Compare Source

Kudos to @​kossnocorp, @​sakamossan and @​Revan99 for working on the release. Also thanks to @​seated for sponsoring me.

Added

v3.3.1

Compare Source

Kudos to @​kossnocorp and @​fturmel for working on the release.

Fixed
  • Fixed DST issue in getOverlappingDaysInIntervals, resulting in an inconsistent number of days returned for intervals starting and ending in different DST periods.

  • Fixed functions incorrectly using trunc instead of round. The bug was introduced in v3.3.0. The affected functions: differenceInCalendarDays, differenceInCalendarISOWeeks, differenceInCalendarWeeks, getISOWeek, getWeek, and getISOWeeksInYear.

v3.3.0

Compare Source

On this release worked @​kossnocorp, @​TheKvikk, @​fturmel and @​ckcherry23.

Fixed
  • Fixed the bug in getOverlappingDaysInIntervals caused by incorrect sorting of interval components that led to 0 for timestamps of different lengths.

  • Fixed bugs when working with negative numbers caused by using Math.floor (-1.1-2) instead of Math.trunc (-1.1-1). Most of the conversion functions (i.e., hoursToMinutes) were affected when passing some negative fractional input. Also, some other functions that could be possibly affected by unfortunate timezone/date combinations were fixed.

    The functions that were affected: format, parse, getUnixTime, daysToWeeks, hoursToMilliseconds, hoursToMinutes, hoursToSeconds, milliseconds, minutesToMilliseconds, millisecondsToMinutes, monthsToYears, millisecondsToHours, millisecondsToSeconds, minutesToHours, minutesToSeconds, yearsToQuarters, yearsToMonths, yearsToDays, weeksToDays, secondsToMinutes, secondsToHours, quartersToYears, quartersToMonths and monthsToQuarters.

  • Fixed the Czech locale's formatDistance to include 1 in formatDistance.

  • Fixed differenceInSeconds and other functions relying on rounding options that can produce a negative 0.

  • Added a preprocessor to the locales API, enabling fixing a long-standing bug in the French locale. (#​1391)

  • Added missing yearsToDays to the FP submodule.

  • Made functions using rounding methods always return 0 instead of -0.

Added

v3.2.0

Compare Source

This release is brought to you by @​kossnocorp, @​fturmel, @​grossbart, @​MelvinVermeer, and @​jcarstairs-scottlogic.

Fixed
Added
  • Added exports of format, lightFormat, and parse internals that enable 3rd-parties to consume those.

v3.1.0

Compare Source

This release is brought to you by @​kossnocorp, @​makstyle119 and @​dmgawel.

Fixed
Added

v3.0.6

Compare Source

On this release worked @​imwh0im, @​jamcry and @​tyrw.

Fixed

v3.0.5

Compare Source

This release is brought to you by @​goku4199.

Fixed

v3.0.4

Compare Source

This release is brought to you by @​kossnocorp.

Fixed
  • Fixed isWithinInterval bug caused by incorrectly sorting dates (#​3623).

v3.0.3

Compare Source

Fixed
  • Rolled back pointing ESM types to the same d.ts files. Instead now it copies the content to avoid the Masquerading as CJS problem reported by "Are the types wrong?".

v3.0.2

Compare Source

Fixed

v3.0.1

Compare Source

Fixed
  • Fixed an error in certain environments caused by d.mts files exporting only types.

v3.0.0

Compare Source

Changed
  • BREAKING: date-fns is now a dual-package with the support of both ESM and CommonJS. The files exports are now explicitly in the package.json. The ESM files now have .mjs extension.

  • BREAKING: The package now has a flat structure, meaning functions are now named node_modules/date-fns/add.mjs, locales are node_modules/date-fns/locale/enUS.mjs, etc.

  • BREAKING: Now all file content’s exported via named exports instead of export default, which will require change direct imports i.e. const addDays = require(‘date-fns/addDays’) to const { addDays } = require(‘date-fns/addDays’).

  • BREAKING: TypeScript types are now completely rewritten, check out the d.ts files for more information.

  • BREAKING: constants now is not exported via the index, so to import one use import { daysInYear } from "date-fns/constants";. It improves compatibility with setups that modularize imports like Next.js.

  • BREAKING: Functions now don’t check the number of passed arguments, delegating this task to type checkers. The functions are now slimmer because of this.

  • BREAKING The arguments are not explicitly converted to the target types. Instead, they are passed as is, delegating this task to type checkers.

  • BREAKING: Functions that accept Interval arguments now do not throw an error if the start is before the end and handle it as a negative interval. If one of the properties in an Invalid Date, these functions also do not throw and handle them as invalid intervals.

    • areIntervalsOverlapping normalize intervals before comparison, so { start: a, end: b } is practically equivalent to { start: b, end: a }. When comparing intervals with one of the properties being Invalid Date, the function will return false unless the others are valid and equal, given the inclusive option is passed. Otherwise, and when even one of the intervals has both properties invalid, the function will always return false.

    • getOverlappingDaysInIntervals now normalizes intervals before comparison, so { start: a, end: b } is practically equivalent to { start: b, end: a }. If any of the intervals’ properties is an Invalid Date, the function will always return 0.

    • isWithinInterval now normalizes intervals before comparison, so { start: a, end: b } is practically equivalent to { start: b, end: a }. If any of the intervals’ properties is an Invalid Date, the function will always return false.

    • intervalToDuration now returns negative durations for negative intervals. If one or both of the interval properties are invalid, the function will return an empty object.

    • The eachXOfInterval functions (eachDayOfInterval, eachHourOfInterval, eachMinuteOfInterval, eachMonthOfInterval, eachWeekendOfInterval, eachWeekendOfMonth, eachWeekendOfYear, eachWeekOfInterval, eachYearOfInterval) now return a reversed array if the passed interval’s start is after the end. Invalid properties will result in an empty array. Functions that accept the step option now also allow negative, 0, and NaN values and return reversed results if the step is negative and an empty array otherwise.

  • BREAKING: intervalToDuration now skips 0 values in the resulting duration, resulting in more compact objects with only relevant properties.

  • BREAKING: roundToNearestMinutes now returns Invalid Date instead of throwing an error when nearestTo option is less than 1 or more than 30.

  • BREAKING: IE is no longer supported.

  • BREAKING: Now all functions use Math.trunc rounding method where rounding is required. The behavior is configurable on a per-function basis.

  • BREAKING: Undocumented onlyNumeric option was removed from nn and sv locales. If you relied on it, please contact me.

  • BREAKING: Flow is not supported anymore. If you relied on it, please contact me.

  • BREAKING: The locales now use regular functions instead of the UTC version, which should not break any code unless you used locales directly.

Added
  • All functions that accept date arguments now also accept strings.

  • All functions now export options interfaces.

  • Now functions allow passing custom Date extensions like UTCDate. They will detect and use the arguments constructor to generate the result of the same class.

  • eachMonthOfInterval, eachQuarterOfInterval, eachWeekOfInterval, and eachYearOfInterval now accept the step option like most of the eachXOfInterval functions.

  • A new interval function that validates interval, emulating the v2 interval functions behavior.

  • differenceInX functions now accept options and allow setting up roundingMethod that configures how the result is rounded. Math.trunc is the default method.

marnusw/date-fns-tz (date-fns-tz)

v3.1.3

Compare Source

  • [BUGFIX] Make getTimeZoneOffset's 2nd arg optional

v3.1.2

Compare Source

  • [BUGFIX] Fix formatInTimeZone use of timeZone string (#​280)

v3.1.1

Compare Source

  • [BUGFIX] getTimeZoneOffset's 2nd arg should be optional (#​281)

v3.1.0

Compare Source

  • [REFACTOR] Full rewrite in TypeScript (#​278) Thank you, @​brettwillis
  • [BREAKING CHANGE] OptionsWithTZ is now either FormatOptionsWithTZ or ToDateOptionsWithTZ, matching date-fns

v3.0.1

Compare Source

  • [BUGFIX] Fix named export typings (#​277)

v3.0.0

Compare Source

  • [UPGRADE] Support date-fns v3 (#​265) Thank you, @​christopherklint97
  • [BUGFIX] Correct import of date-fns@v3 format and use Babel Webpack loader for mjs files (#​271)
  • [BREAKING CHANGE] date-fns v2 is no longer supported
  • [BREAKING CHANGE] Renamed utcToZonedTime to toZonedTime to make the name less confusing, just search & replace
  • [BREAKING CHANGE] Renamed zonedTimeToUtc to fromZonedTime to make the name less confusing, just search & replace
  • [BREAKING CHANGE] All functions are now exported using named exports, this requires changing direct
    imports from import formatInTimeZone from 'date-fns-tz/formatInTimeZone' to
    import { formatInTimeZone } from 'date-fns-tz/formatInTimeZone'
  • [BREAKING CHANGE] Functions now don’t check the number of passed arguments, delegating this task to type checkers
    (This isn't fully implemented yet, but it should be the assumption moving forward, as it is in date-fns)
  • [BREAKING CHANGE] Arguments are not explicitly converted to the target types. Instead, they are passed as is,
    delegating this task to type checkers (This isn't fully implemented yet, but it should be the assumption
    moving forward, as it is in date-fns)
  • [BREAKING CHANGE] IE is no longer supported since date-fns no longer supports it
  • [BREAKING CHANGE] Removed flow support since date-fns also removed it

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

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


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Summary by CodeRabbit

  • New Features

    • Upgraded date-fns to version 3.6.0, enhancing date manipulation capabilities.
    • Updated date-fns-tz to version 3.1.3, improving timezone handling.
  • Bug Fixes

    • The updates may resolve previous issues related to date and timezone functionalities.

@renovate renovate bot requested a review from tatsutakein as a code owner April 9, 2024 03:24
@renovate renovate bot added the dependencies Pull requests that update a dependency file label Apr 9, 2024
Copy link

coderabbitai bot commented Apr 9, 2024

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

Parsing errors (1)
Validation error: Invalid enum value. Expected 'de' | 'de-DE' | 'de-AT' | 'de-CH' | 'en' | 'en-US' | 'en-AU' | 'en-GB' | 'en-CA' | 'en-NZ' | 'en-ZA' | 'es' | 'es-AR' | 'fr' | 'fr-CA' | 'fr-CH' | 'fr-BE' | 'nl' | 'nl-BE' | 'pt-AO' | 'pt' | 'pt-BR' | 'pt-MZ' | 'pt-PT' | 'ar' | 'ast-ES' | 'ast' | 'be-BY' | 'be' | 'br-FR' | 'br' | 'ca-ES' | 'ca' | 'ca-ES-valencia' | 'ca-ES-balear' | 'da-DK' | 'da' | 'de-DE-x-simple-language' | 'el-GR' | 'el' | 'eo' | 'fa' | 'ga-IE' | 'ga' | 'gl-ES' | 'gl' | 'it' | 'ja-JP' | 'ja' | 'km-KH' | 'km' | 'ko-KR' | 'ko' | 'pl-PL' | 'pl' | 'ro-RO' | 'ro' | 'ru-RU' | 'ru' | 'sk-SK' | 'sk' | 'sl-SI' | 'sl' | 'sv' | 'ta-IN' | 'ta' | 'tl-PH' | 'tl' | 'tr' | 'uk-UA' | 'uk' | 'zh-CN' | 'zh' | 'crh-UA' | 'crh' | 'nb' | 'no' | 'nl-NL' | 'de-DE-x-simple-language-DE' | 'es-ES' | 'it-IT' | 'fa-IR' | 'sv-SE' | 'de-LU' | 'fr-FR', received 'jp' at "language"
Configuration instructions
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

The recent changes involve updating the dependencies for date handling in the frontend application. The date-fns library has been upgraded to version 3.6.0, and date-fns-tz has been updated to version 3.1.3. These updates reflect changes in versioning that may include new features, improvements, or bug fixes related to date manipulation and timezone management.

Changes

File Change Summary
apps/frontend/package.json Updated date-fns from 2.30.0 to 3.6.0 and date-fns-tz from 2.0.1 to 3.1.3.

Poem

In the garden of code, where dates dance and play,
Upgraded our libs, making bright a new day.
With date-fns and tz, time flows like a stream,
Hopping through changes, oh what a sweet dream!
🌼🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added @apps/frontend Frontend development @type/fix labels Apr 9, 2024
@renovate renovate bot force-pushed the renovate/major-date-fns branch 6 times, most recently from fea78af to 7ec25f1 Compare April 17, 2024 08:39
@renovate renovate bot force-pushed the renovate/major-date-fns branch 2 times, most recently from 72e51db to 85a03dd Compare April 23, 2024 15:50
@renovate renovate bot force-pushed the renovate/major-date-fns branch 4 times, most recently from c9a7fae to 9a8f2b4 Compare May 6, 2024 15:37
@renovate renovate bot force-pushed the renovate/major-date-fns branch 3 times, most recently from f68d08a to b3c252c Compare May 16, 2024 13:09
@renovate renovate bot force-pushed the renovate/major-date-fns branch 2 times, most recently from 3a56083 to 6604554 Compare May 25, 2024 15:04
@renovate renovate bot force-pushed the renovate/major-date-fns branch 2 times, most recently from 685ba84 to 253071e Compare May 27, 2024 23:03
@renovate renovate bot force-pushed the renovate/major-date-fns branch from 253071e to 71840f1 Compare June 4, 2024 14:51
@renovate renovate bot force-pushed the renovate/major-date-fns branch 3 times, most recently from cd83449 to 00eb6cf Compare June 17, 2024 00:07
@renovate renovate bot force-pushed the renovate/major-date-fns branch 2 times, most recently from d41deed to e76c90f Compare June 29, 2024 09:04
@renovate renovate bot force-pushed the renovate/major-date-fns branch 2 times, most recently from 6e15208 to d5c7e46 Compare July 5, 2024 06:21
@renovate renovate bot force-pushed the renovate/major-date-fns branch 2 times, most recently from 91dfc92 to 4ab5cf9 Compare July 11, 2024 11:43
@renovate renovate bot force-pushed the renovate/major-date-fns branch 4 times, most recently from 060226e to b02505e Compare July 20, 2024 17:26
@renovate renovate bot force-pushed the renovate/major-date-fns branch 3 times, most recently from 229336a to 26c8ee9 Compare August 1, 2024 22:10
@renovate renovate bot force-pushed the renovate/major-date-fns branch 2 times, most recently from 8a1ee7d to 9926e36 Compare August 8, 2024 20:15
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 09ca9ff and f183fb3.

Files selected for processing (1)
  • apps/frontend/package.json (1 hunks)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f183fb3 and fe44664.

Files selected for processing (1)
  • apps/frontend/package.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/frontend/package.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fe44664 and 3654746.

Files selected for processing (1)
  • apps/frontend/package.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/frontend/package.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3654746 and 9cb20f0.

Files selected for processing (1)
  • apps/frontend/package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • apps/frontend/package.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9cb20f0 and ed6754a.

Files selected for processing (1)
  • apps/frontend/package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • apps/frontend/package.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ed6754a and fe3852f.

Files selected for processing (1)
  • apps/frontend/package.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/frontend/package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@apps/frontend Frontend development dependencies Pull requests that update a dependency file @type/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants