Implements calendar generation.