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: ensure arguments are supported on all reactive Date methods #10813

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wise-dodos-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"svelte": patch
---

fix: ensure arguments are supported on all reactive Date methods
6 changes: 3 additions & 3 deletions packages/svelte/src/reactivity/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ export class ReactiveDate extends Date {

for (const method of read) {
// @ts-ignore
proto[method] = function () {
proto[method] = function (...args) {
get(this.#raw_time);
// @ts-ignore
return date_proto[method].call(this);
return date_proto[method].apply(this, args);
};
}

for (const method of write) {
// @ts-ignore
proto[method] = function (/** @type {any} */ ...args) {
proto[method] = function (...args) {
// @ts-ignore
const v = date_proto[method].apply(this, args);
const time = date_proto.getTime.call(this);
Expand Down
Loading