UnmarshalJSON implements the [json.Unmarshaler] interface.
(b []byte)
| 112 | |
| 113 | // UnmarshalJSON implements the [json.Unmarshaler] interface. |
| 114 | func (d *DateTime) UnmarshalJSON(b []byte) error { |
| 115 | var raw string |
| 116 | if err := json.Unmarshal(b, &raw); err != nil { |
| 117 | return err |
| 118 | } |
| 119 | return d.Scan(raw) |
| 120 | } |
| 121 | |
| 122 | // Value implements the [driver.Valuer] interface. |
| 123 | func (d DateTime) Value() (driver.Value, error) { |