ParseDIntervalWithTypeMetadata is like ParseDInterval, but it also takes a types.IntervalTypeMetadata that both specifies the units for unitless, numeric intervals and also specifies the precision of the interval.
(s string, itm types.IntervalTypeMetadata)
| 1180 | // types.IntervalTypeMetadata that both specifies the units for unitless, numeric intervals |
| 1181 | // and also specifies the precision of the interval. |
| 1182 | func ParseDIntervalWithTypeMetadata(s string, itm types.IntervalTypeMetadata) (*DInterval, error) { |
| 1183 | d, err := parseDInterval(s, itm) |
| 1184 | if err != nil { |
| 1185 | return nil, err |
| 1186 | } |
| 1187 | truncateDInterval(d, itm) |
| 1188 | return d, nil |
| 1189 | } |
| 1190 | |
| 1191 | func parseDInterval(s string, itm types.IntervalTypeMetadata) (*DInterval, error) { |
| 1192 | // At this time the only supported interval formats are: |
no test coverage detected