Fix resource.calendar backward days scheduling issue

Fix to #4029