func (t Time) Minute() int {
	return t.t.Minute()
}
Minute returns the minute offset within the hour specified by t, in the
range [0, 59].
package builtin
import (
	"fmt"
	"time"
	"github.com/open2b/scriggo/native"
)
type Duration = time.Duration
type Time struct {
	t time.Time
}
func NewTime(t time.Time) Time {
	return Time{t}
}
func (t Time) Add(d Duration) Time {
	return Time{t.t.Add(d)}
}
func (t Time) AddDate(years, months, days int) Time {
	return Time{t.t.AddDate(years, months, days)}
}
func (t Time) After(u Time) bool {
	return t.t.After(u.t)
}
func (t Time) Before(u Time) bool {
	return t.t.Before(u.t)
}
func (t Time) Clock() (hour, minute, second int) {
	return t.t.Clock()
}
func (t Time) Date() (year, month, day int) {
	y, m, d := t.t.Date()
	return y, int(m), d
}
func (t Time) Day() int {
	return t.t.Day()
}
func (t Time) Equal(u Time) bool {
	return t.t.Equal(u.t)
}
func (t Time) Format(layout string) string {
	return t.t.Format(layout)
}
func (t Time) Hour() int {
	return t.t.Hour()
}
func (t Time) IsZero() bool {
	return t.t.IsZero()
}
func (t Time) JS() native.JS {
	y := t.t.Year()
	ms := int64(t.t.Nanosecond()) / int64(time.Millisecond)
	name, offset := t.t.Zone()
	if name == "UTC" {
		format := `new Date("%0.4d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2d.%0.3dZ")`
		if y < 0 || y > 9999 {
			format = `new Date("%+0.6d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2d.%0.3dZ")`
		}
		return native.JS(fmt.Sprintf(format, y, t.t.Month(), t.t.Day(), t.t.Hour(), t.t.Minute(), t.t.Second(), ms))
	}
	zone := offset / 60
	h, m := zone/60, zone%60
	if m < 0 {
		m = -m
	}
	format := `new Date("%0.4d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2d.%0.3d%+0.2d:%0.2d")`
	if y < 0 || y > 9999 {
		format = `new Date("%+0.6d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2d.%0.3d%+0.2d:%0.2d")`
	}
	return native.JS(fmt.Sprintf(format, y, t.t.Month(), t.t.Day(), t.t.Hour(), t.t.Minute(), t.t.Second(), ms, h, m))
}
func (t Time) JSON() native.JSON {
	return native.JSON(`"` + t.t.Format(time.RFC3339) + `"`)
}
func (t Time) Month() int {
	return int(t.t.Month())
}