allow specifying a date instead of an index