Skip to content

fix(date): return Date instead of number#18261

Merged
rstoenescu merged 1 commit intoquasarframework:devfrom
Kundan-CR7:fix-date-max-min-return-type
Mar 23, 2026
Merged

fix(date): return Date instead of number#18261
rstoenescu merged 1 commit intoquasarframework:devfrom
Kundan-CR7:fix-date-max-min-return-type

Conversation

@Kundan-CR7
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Documentation
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

fixes #18260
Does this PR introduce a breaking change?

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch (or v[X] branch)
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #<issue-number>)
  • It's been tested on a Cordova (iOS, Android) app
  • It's been tested on an Electron app
  • Any necessary documentation has been added or updated

Problem

getMaxDate and getMinDate currently return a numeric timestamp instead of a Date object.

This happens because Math.max() / Math.min() convert Date objects into timestamps.

Example:

const d1 = new Date('2024-01-01')
const d2 = new Date('2024-06-01')

const result = date.getMaxDate(d1, d2)

console.log(typeof result) // number
console.log(result instanceof Date) // false

result.getFullYear() // TypeError

@rstoenescu rstoenescu merged commit 2e0c2a8 into quasarframework:dev Mar 23, 2026
1 check passed
@rstoenescu
Copy link
Copy Markdown
Member

Thanks for contributing!

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.

date utils: getMaxDate / getMinDate return number instead of Date object

2 participants