HughParsonage / grattan

Common quantitative tasks for Australian policy analysts
25 stars 8 forks source link

Verify Date #132

Closed MatthewKatzen closed 6 years ago

MatthewKatzen commented 6 years ago

I've tried to make it as similar to the errors you made for rent_assistance, except I'm trying to figure out what if (!inherits(Date, "Date")) does. Is it checking if the object Date is a Date class?

HughParsonage commented 6 years ago

Yes.

inherits("2015-12-01", "Date")
# [1] FALSE
inherits(as.Date("2015-12-01"), "Date")
# [1] TRUE
HughParsonage commented 6 years ago

To summarize we dropped the attributes idea: unlike validate_fy we already have a Date class so adding attributes won't add much and min and max are efficient enough for this class.