Added the implementation for the beforeShowDay method