getTimeZhiIndex static method
Implementation
static int getTimeZhiIndex(String hm) {
if (hm.length > 5) {
hm = hm.substring(0, 5);
}
int x = 1;
for (int i = 1; i < 22; i += 2) {
if (hm.compareTo((i < 10 ? '0' : '') + i.toString() + ':00') >= 0 &&
hm.compareTo((i + 1 < 10 ? '0' : '') + (i + 1).toString() + ':59') <=
0) {
return x;
}
x++;
}
return 0;
}