Updated eow and eonw calculation to also work on OSX

Signed-off-by: Josemi Liébana <office@josemi-liebana.com>