Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-gao committed Oct 14, 2024
2 parents ca4a58e + 146182a commit 3bab093
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ public static function localDateAndTimeFormatter($date) {
$drupal_date_time = new DrupalDateTime($date, $storage_tz);
// Convert to local timezone.
$system_tz = \Drupal::service('config.factory')->get('system.date')->get('timezone.default');
$date_formatter = \Drupal::service('date.formatter');
$converted_date = $date_formatter->format($drupal_date_time->getTimeStamp(), 'custom', 'Y-m-d H:i:s', $system_tz);
return $converted_date;
$drupal_date_time->setTimezone(new \DateTimeZone($system_tz));
return $drupal_date_time->format(\DateTime::ATOM);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ public function viewsForm(&$form, FormStateInterface $form_state) {
// Remove the default actions build array.
unset($form['actions']);
}

// Removed delete option for approver role.
$roles = $current_user->getRoles();
if (
in_array('approver', $roles) &&
isset($form['header']['node_bulk_form']['action']['#options']['node_delete_action'])
) {
unset($form['header']['node_bulk_form']['action']['#options']['node_delete_action']);
}
}

}

0 comments on commit 3bab093

Please sign in to comment.