Skip to content

Commit 474fc7e

Browse files
authored
fix: ensure arguments are supported on all reactive Date methods (#10813)
1 parent afc2eea commit 474fc7e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/wise-dodos-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: ensure arguments are supported on all reactive Date methods

packages/svelte/src/reactivity/date.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ export class ReactiveDate extends Date {
6868

6969
for (const method of read) {
7070
// @ts-ignore
71-
proto[method] = function () {
71+
proto[method] = function (...args) {
7272
get(this.#raw_time);
7373
// @ts-ignore
74-
return date_proto[method].call(this);
74+
return date_proto[method].apply(this, args);
7575
};
7676
}
7777

7878
for (const method of write) {
7979
// @ts-ignore
80-
proto[method] = function (/** @type {any} */ ...args) {
80+
proto[method] = function (...args) {
8181
// @ts-ignore
8282
const v = date_proto[method].apply(this, args);
8383
const time = date_proto.getTime.call(this);

0 commit comments

Comments
 (0)