You are here

function jquery_calendar_datepicker_themes in jQuery World Calendars API 3.x

Internal helper to collect all datepicker themes.

Return value

An array of datepicker theme component names.

1 call to jquery_calendar_datepicker_themes()
Settings::buildForm in src/Form/Settings.php
Form constructor.

File

./jquery_calendar.module, line 32
Implements necessary hooks, API and helpers for jQuery World Calendars.

Code

function jquery_calendar_datepicker_themes() {
  $items = \Drupal::service('library.discovery')
    ->getLibrariesByExtension('jquery_calendar');
  $themes = [];
  foreach ($items as $key => $info) {
    if (preg_match('%jquery_calendars\\.picker\\.theme\\.([^.]+)%i', $key, $matches)) {
      $themes[$matches[1]] = ucwords($matches[1]);
    }
  }
  return $themes;
}