- ok = split(time, t, ":")
- if (ok) {
- hour = t[1] + 0 # Coerce number from string
- cnt = count[hour]++
+ d_fields = split(date, d, "-")
+ t_fields = split(time, t, ":")
+ if (t_fields && d_fields) {
+ # +0 to coerce number from string
+ year = d[1] + 0
+ month = d[2] + 0
+ day = d[3] + 0
+ hour = t[1] + 0
+ dow = date2dow(year, month, day)
+ g = group_by == "mon" ? month : dow # dow is default
+ c = count[g, hour]++