-
Notifications
You must be signed in to change notification settings - Fork 600
Open
Description
The package seems to suggest it supports go time.Time objects and parsing them into Javascript dates, however with a minimal working example this doesn't seem to work:
vm := otto.New()
vm.Set("subject", time.Date(2024, 1, 15, 10, 30, 45, 0, time.UTC))
value, err := vm.Run(`
console.log("The value of subject is " + typeof(subject));
console.log("The subject is " + subject.toISOString());
subject;
`)
if err != nil {
return err
}
spew.Dump(value)
outputs:
The value of subject is object
TypeError: "toISOString" is not a function
Metadata
Metadata
Assignees
Labels
No labels