Updated eow and eonw calculation to also work on OSX

Signed-off-by: Josemi Liébana <office@josemi-liebana.com>
Merge pull request #2 from titosemi/master

Updated eow and eonw calculation to also work on OSX