[BUG #8116] some refactoring
[BUG #8141] check for display: none since the calendar is always rendered