| 31 | } |
| 32 | |
| 33 | func parseMonth(s string) (time.Month, error) { |
| 34 | switch s { |
| 35 | case "JAN": |
| 36 | return time.January, nil |
| 37 | case "FEB": |
| 38 | return time.February, nil |
| 39 | case "MAR": |
| 40 | return time.March, nil |
| 41 | case "APR": |
| 42 | return time.April, nil |
| 43 | case "MAY": |
| 44 | return time.May, nil |
| 45 | case "JUN": |
| 46 | return time.June, nil |
| 47 | case "JUL": |
| 48 | return time.July, nil |
| 49 | case "AUG": |
| 50 | return time.August, nil |
| 51 | case "SEP": |
| 52 | return time.September, nil |
| 53 | case "OCT": |
| 54 | return time.October, nil |
| 55 | case "NOV": |
| 56 | return time.November, nil |
| 57 | case "DEC": |
| 58 | return time.December, nil |
| 59 | default: |
| 60 | return 0, fmt.Errorf("unable to parse month name: %q", s) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func wdRange(vm *goja.Runtime, a, b string, gmt bool) goja.Value { |
| 65 | a = strings.ToUpper(a) |