appview/{db,state}: handle index out-of-bound for punchcards
The date compare should be done with years.
Also, previous puchcard didn't work except for December because `idx`
can be negative while iterating the punchcard. Not sure why most
account pages aren't affected
Signed-off-by: Seongmin Lee <git@boltless.me>