code: public static boolean isMaintenanceWindowValid(final MaintenanceWindowLayout maintenanceWindowLayout,
              final UINotification notification) {
          if (maintenanceWindowLayout.isEnabled()) {
              try {
                  MaintenanceScheduleHelper.validateMaintenanceSchedule(maintenanceWindowLayout.getMaintenanceSchedule(),
                          maintenanceWindowLayout.getMaintenanceDuration(),
                          maintenanceWindowLayout.getMaintenanceTimeZone());
              } catch (final InvalidMaintenanceScheduleException e) {
                  LOG.error("Maintenance window is not valid", e);
                  notification.displayValidationError(e.getMessage());
                  return false;
              }
          }
          return true;
      }
docs: Check wether the maintenance window is valid or not
  
  @param maintenanceWindowLayout
  the maintenance window layout
  @param notification
  the UI Notification
  @return boolean if maintenance window is valid or not