bug #2506 Datepicker displays wrong week numbers

fix bug #2506 Datepicker displays wrong week numbers.
also fixed some white space problems jshint was complaining about.