add min and max day support, hacky but working