Some tweaks

– Try to idiot proof user options
– Pass window as a param
– Check passed options before calculating a date