func (ctx *Context) NewDate() (*Object, error) { errVal := ctx.newErrorValue() ret := C.JSObjectMakeDate(ctx.ref, 0, nil, &errVal.ref) if errVal.ref != nil { return nil, errVal } return ctx.newObject(ret), nil }
func (ctx *Context) NewDateWithString(date string) (*Object, error) { errVal := ctx.newErrorValue() param := ctx.NewStringValue(date) ret := C.JSObjectMakeDate(ctx.ref, C.size_t(1), ¶m.ref, &errVal.ref) if errVal.ref != nil { return nil, errVal } return ctx.newObject(ret), nil }
func (ctx *Context) NewDateWithMilliseconds(milliseconds float64) (*Object, error) { errVal := ctx.newErrorValue() param := ctx.NewNumberValue(milliseconds) ret := C.JSObjectMakeDate(ctx.ref, C.size_t(1), ¶m.ref, &errVal.ref) if errVal.ref != nil { return nil, errVal } return ctx.newObject(ret), nil }