functional calendar implementation