Skip to content
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