Returns a list of all the names of the months.

@return array the month names
437086
public function get_months() {
        $months = array();

        $date = new \DateTime('@1263556800');
        $date->setTimezone(new \DateTimeZone('UTC'));
        for ($i = 1; $i <= 12; $i++) {
            $date->setDate(2000, $i, 15);
            $months[$i] = userdate($date->getTimestamp(), '%B', 'UTC');
        }

        return $months;
    }
1178555
private static Map<String, Integer> monthsMapping() {
        final Map<String, Integer> stringMapping = new HashMap<>();
        stringMapping.put("JAN", 1);
        stringMapping.put("FEB", 2);
        stringMapping.put("MAR", 3);
        stringMapping.put("APR", 4);
        stringMapping.put("MAY", 5);
        stringMapping.put("JUN", 6);
        stringMapping.put("JUL", 7);
        stringMapping.put("AUG", 8);
        stringMapping.put("SEP", 9);
        stringMapping.put("OCT", 10);
        stringMapping.put("NOV", 11);
        stringMapping.put("DEC", 12);
        return stringMapping;
    }
356996
private function monthOptions(): array
    {
        return [
            3  => I18N::number(3),
            6  => I18N::number(6),
            9  => I18N::number(9),
            12 => I18N::number(12),
            18 => I18N::number(18),
            24 => I18N::number(24),
        ];
    }
977576
public static function monthStringToNumber($month)
    {
        $monthIndex = 1;
        foreach (self::$monthNames as $shortMonthName => $longMonthName) {
            if (($month === $longMonthName) || ($month === $shortMonthName)) {
                return $monthIndex;
            }
            ++$monthIndex;
        }
        return $month;
    }
406778
public static function ListAll()
    {
        $data = [];
        //
        $folders = glob(Application::$root.'resources/translator/*');
        //
        foreach ($folders as $key => $value) {
            $folder = \Strings::splite($value, 'resources/translator/');
            $folder = $folder[1];
            //
            $data[] = '>'.$folder;
            //
            foreach (glob(Application::$root.'resources/translator/'.$folder.'/*.php') as $key2 => $value2) {
                $file = \Strings::splite($value2, "app/lang/$folder/");
                $file = $file[1];
                //
                $data[] = '   '.$file;
            }
        }
        //
        return $data;
    }
667657
public function getNames(){
		
		$isSet = PHPArray::filter(static::getConstants(), function($value){
			return $this->hasFlag($value);
		});
		
		return \array_keys($isSet);
		
	}
571577
public function getNames()
    {
        $branches = $this->execute();
        $branches = \explode("\n", $branches);
        $branches = \array_map(
            function ($branch) {
                return \ltrim($branch, '*');
            },
            $branches
        );
        $branches = \array_map('trim', $branches);
        $branches = \array_filter($branches);

        return $branches;
    }
913248
public function month($options = array())
    {
        $options = new AnConfig($options);

        $options->append(array(
            'selected' => null,
            'prompt' => true,
        ));

        $selected = $options->selected;
        unset($options->selected);
        $prompt = $options->prompt;

        $months = array(
            1 => AnTranslator::_('LIB-AN-JANUARY'),
            2 => AnTranslator::_('LIB-AN-FEBRURARY'),
            3 => AnTranslator::_('LIB-AN-MARCH'),
            4 => AnTranslator::_('LIB-AN-APRIL'),
            5 => AnTranslator::_('LIB-AN-MAY'),
            6 => AnTranslator::_('LIB-AN-JUNE'),
            7 => AnTranslator::_('LIB-AN-JULY'),
            8 => AnTranslator::_('LIB-AN-AUGUST'),
            9 => AnTranslator::_('LIB-AN-SEPTEMBER'),
            10 => AnTranslator::_('LIB-AN-OCTOBER'),
            11 => AnTranslator::_('LIB-AN-NOVEMBER'),
            12 => AnTranslator::_('LIB-AN-DECEMBER'),
        );

        unset($options->prompt);

        if ($prompt) {
            $array = array(AnTranslator::_('LIB-AN-SELECTOR-SELECT-MONTH'), null);
            $months = AnHelperArray::merge($array, $months);
        }

        return $this->_html->select($options->name, array('options' => $months, 'selected' => $selected), AnConfig::unbox($options));
    }
626036
protected function formatGedcomMonth(): string
    {
        // Our simple lookup table doesn't work correctly for Adar on leap years
        if ($this->month === 7 && $this->calendar instanceof JewishCalendar && !$this->calendar->isLeapYear($this->year)) {
            return 'ADR';
        }

        return array_search($this->month, static::MONTH_ABBREVIATIONS, true);
    }
639883
public static function getAll()
    {
        $timezones = [];
        $identifiers = DateTimeZone::listIdentifiers();
        foreach ($identifiers as $identifier) {
            $date = new DateTime("now", new DateTimeZone($identifier));
            $offsetText = $date->format("P");
            $offsetInHours = $date->getOffset() / 60 / 60;
            $timezones[] = [
                "identifier" => $identifier,
                "name" => "(GMT{$offsetText}) $identifier",
                "offset" => $offsetInHours
            ];
        }

        ArrayHelper::multisort($timezones, "offset", SORT_ASC, SORT_NUMERIC);
        return $timezones;
    }
307744
public function months($months)
    {
        return sprintf($this->formatPattern, $months, $this->month_words[$this->pluralization($months)]);
    }
679678
private static function calInfoCalendar($month_names, $month_names_short, $max_days_in_month, $calendar_name, $calendar_symbol)
    {
        return array(
            'months'         => array_slice($month_names, 1, null, true),
            'abbrevmonths'   => array_slice($month_names_short, 1, null, true),
            'maxdaysinmonth' => $max_days_in_month,
            'calname'        => $calendar_name,
            'calsymbol'      => $calendar_symbol,
        );
    }
760603
public function getPeriods()
  {
    $periods = array();

    $this->Period->byOrganization($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($Period) use (&$periods)
    {
      array_push($periods, array('id'=> $Period->id, 'month' => $this->Lang->get('decima-accounting::period-management.' . $Period->month), 'startDate'=>$Period->start_date, 'endDate'=>$Period->end_date));
    });

    return $periods;
  }
443028
public static function calendarNames(): array
    {
        return [
            /* I18N: The gregorian calendar */
            'gregorian' => I18N::translate('Gregorian'),
            /* I18N: The julian calendar */
            'julian'    => I18N::translate('Julian'),
            /* I18N: The French calendar */
            'french'    => I18N::translate('French'),
            /* I18N: The Hebrew/Jewish calendar */
            'jewish'    => I18N::translate('Jewish'),
            /* I18N: The Arabic/Hijri calendar */
            'hijri'     => I18N::translate('Hijri'),
            /* I18N: The Persian/Jalali calendar */
            'jalali'    => I18N::translate('Jalali'),
        ];
    }
673029
public function getCardFields()
    {
        $months = array();
        //generate list of months
        for ($x = 1; $x <= 12; $x++) {
            // Fixes #145 - Thanks to @digitall-it
            $months[$x] = str_pad($x, 2, '0', STR_PAD_LEFT) . " - " . strftime('%B', mktime(0, 0, 0, $x));
        }
        $year = date('Y');
        $range = 5;
        $startrange = range(date('Y', strtotime("-$range years")), $year);
        $expiryrange = range($year, date('Y', strtotime("+$range years")));

        $fields = array(
            'type' => DropdownField::create(
                $this->getFieldName('type'),
                _t('SilverStripe\Omnipay\PaymentForm.Type', 'Type'),
                $this->getCardTypes()
            ),
            'name' => TextField::create(
                $this->getFieldName('name'),
                _t('SilverStripe\Omnipay\PaymentForm.Name', 'Name on Card')
            ),
            'number' => TextField::create(
                $this->getFieldName('number'),
                _t('SilverStripe\Omnipay\PaymentForm.Number', 'Card Number')
            )->setDescription(_t('SilverStripe\Omnipay\PaymentForm.NumberDescription', 'no dashes or spaces')),
            'startMonth' => DropdownField::create(
                $this->getFieldName('startMonth'),
                _t('SilverStripe\Omnipay\PaymentForm.StartMonth', 'Month'),
                $months
            )->setHasEmptyDefault(true)->setEmptyString(_t('SilverStripe\Omnipay\PaymentForm.StartMonthDefaultText', 'Please Select ...')),
            'startYear' => DropdownField::create(
                $this->getFieldName('startYear'),
                _t('SilverStripe\Omnipay\PaymentForm.StartYear', 'Year'),
                array_combine($startrange, $startrange),
                $year
            )->setHasEmptyDefault(true)->setEmptyString(_t('SilverStripe\Omnipay\PaymentForm.StartYearDefaultText', 'Please Select ...')),
            'expiryMonth' => DropdownField::create(
                $this->getFieldName('expiryMonth'),
                _t('SilverStripe\Omnipay\PaymentForm.ExpiryMonth', 'Month'),
                $months
            )->setHasEmptyDefault(true)->setEmptyString(_t('SilverStripe\Omnipay\PaymentForm.ExpiryMonthDefaultText', 'Please Select ...')),
            'expiryYear' => DropdownField::create(
                $this->getFieldName('expiryYear'),
                _t('SilverStripe\Omnipay\PaymentForm.ExpiryYear', 'Year'),
                array_combine($expiryrange, $expiryrange),
                $year
            )->setHasEmptyDefault(true)->setEmptyString(_t('SilverStripe\Omnipay\PaymentForm.ExpiryYearDefaultText', 'Please Select ...')),
            'cvv' => TextField::create(
                $this->getFieldName('cvv'),
                _t('SilverStripe\Omnipay\PaymentForm.CVV', 'Security Code')
            )->setMaxLength(5),
            'issueNumber' => TextField::create(
                $this->getFieldName('issueNumber'),
                _t('SilverStripe\Omnipay\PaymentForm.IssueNumber', 'Issue Number')
            )
        );

        $this->cullForGateway($fields);
        //optionally group date fields
        if ($this->groupdatefields) {
            if (isset($fields[ 'startMonth' ]) && isset($fields[ 'startYear' ])) {
                $fields[ 'startMonth' ] = FieldGroup::create(
                    _t('SilverStripe\Omnipay\PaymentForm.Start', 'Start'),
                    $fields[ 'startMonth' ],
                    $fields[ 'startYear' ]
                )->addExtraClass('card_startyear');
                unset($fields[ 'startYear' ]);
            }
            if (isset($fields[ 'expiryMonth' ]) && isset($fields[ 'expiryYear' ])) {
                $fields[ 'expiryMonth' ] = FieldGroup::create(
                    _t('SilverStripe\Omnipay\PaymentForm.Expiry', 'Expiry'),
                    $fields[ 'expiryMonth' ],
                    $fields[ 'expiryYear' ]
                )->addExtraClass('card_expiry');
                unset($fields[ 'expiryYear' ]);
            }
        }

        return FieldList::create($fields);
    }
469401
protected function getMonthlyOccurrences()
    {
        $startDate = clone $this->currentDate;

        $byDayResults = [];

        // Our strategy is to simply go through the byDays, advance the date to
        // that point and add it to the results.
        if ($this->byDay) {
            foreach ($this->byDay as $day) {
                $dayName = $this->dayNames[$this->dayMap[substr($day, -2)]];

                // Dayname will be something like 'wednesday'. Now we need to find
                // all wednesdays in this month.
                $dayHits = [];

                // workaround for missing 'first day of the month' support in hhvm
                $checkDate = new \DateTime($startDate->format('Y-m-1'));
                // workaround modify always advancing the date even if the current day is a $dayName in hhvm
                if ($checkDate->format('l') !== $dayName) {
                    $checkDate = $checkDate->modify($dayName);
                }

                do {
                    $dayHits[] = $checkDate->format('j');
                    $checkDate = $checkDate->modify('next '.$dayName);
                } while ($checkDate->format('n') === $startDate->format('n'));

                // So now we have 'all wednesdays' for month. It is however
                // possible that the user only really wanted the 1st, 2nd or last
                // wednesday.
                if (strlen($day) > 2) {
                    $offset = (int) substr($day, 0, -2);

                    if ($offset > 0) {
                        // It is possible that the day does not exist, such as a
                        // 5th or 6th wednesday of the month.
                        if (isset($dayHits[$offset - 1])) {
                            $byDayResults[] = $dayHits[$offset - 1];
                        }
                    } else {
                        // if it was negative we count from the end of the array
                        // might not exist, fx. -5th tuesday
                        if (isset($dayHits[count($dayHits) + $offset])) {
                            $byDayResults[] = $dayHits[count($dayHits) + $offset];
                        }
                    }
                } else {
                    // There was no counter (first, second, last wednesdays), so we
                    // just need to add the all to the list).
                    $byDayResults = array_merge($byDayResults, $dayHits);
                }
            }
        }

        $byMonthDayResults = [];
        if ($this->byMonthDay) {
            foreach ($this->byMonthDay as $monthDay) {
                // Removing values that are out of range for this month
                if ($monthDay > $startDate->format('t') ||
                $monthDay < 0 - $startDate->format('t')) {
                    continue;
                }
                if ($monthDay > 0) {
                    $byMonthDayResults[] = $monthDay;
                } else {
                    // Negative values
                    $byMonthDayResults[] = $startDate->format('t') + 1 + $monthDay;
                }
            }
        }

        // If there was just byDay or just byMonthDay, they just specify our
        // (almost) final list. If both were provided, then byDay limits the
        // list.
        if ($this->byMonthDay && $this->byDay) {
            $result = array_intersect($byMonthDayResults, $byDayResults);
        } elseif ($this->byMonthDay) {
            $result = $byMonthDayResults;
        } else {
            $result = $byDayResults;
        }
        $result = array_unique($result);
        sort($result, SORT_NUMERIC);

        // The last thing that needs checking is the BYSETPOS. If it's set, it
        // means only certain items in the set survive the filter.
        if (!$this->bySetPos) {
            return $result;
        }

        $filteredResult = [];
        foreach ($this->bySetPos as $setPos) {
            if ($setPos < 0) {
                $setPos = count($result) + ($setPos + 1);
            }
            if (isset($result[$setPos - 1])) {
                $filteredResult[] = $result[$setPos - 1];
            }
        }

        sort($filteredResult, SORT_NUMERIC);

        return $filteredResult;
    }
134112
protected function monthNameNominativeCase(int $month, bool $leap_year): string
    {
        static $translated_month_names;

        if ($translated_month_names === null) {
            $translated_month_names = [
                0  => '',
                /* I18N: a month in the Jewish calendar */
                1  => I18N::translateContext('NOMINATIVE', 'Tishrei'),
                /* I18N: a month in the Jewish calendar */
                2  => I18N::translateContext('NOMINATIVE', 'Heshvan'),
                /* I18N: a month in the Jewish calendar */
                3  => I18N::translateContext('NOMINATIVE', 'Kislev'),
                /* I18N: a month in the Jewish calendar */
                4  => I18N::translateContext('NOMINATIVE', 'Tevet'),
                /* I18N: a month in the Jewish calendar */
                5  => I18N::translateContext('NOMINATIVE', 'Shevat'),
                /* I18N: a month in the Jewish calendar */
                6  => I18N::translateContext('NOMINATIVE', 'Adar I'),
                /* I18N: a month in the Jewish calendar */
                7  => I18N::translateContext('NOMINATIVE', 'Adar'),
                /* I18N: a month in the Jewish calendar */
                -7 => I18N::translateContext('NOMINATIVE', 'Adar II'),
                /* I18N: a month in the Jewish calendar */
                8  => I18N::translateContext('NOMINATIVE', 'Nissan'),
                /* I18N: a month in the Jewish calendar */
                9  => I18N::translateContext('NOMINATIVE', 'Iyar'),
                /* I18N: a month in the Jewish calendar */
                10 => I18N::translateContext('NOMINATIVE', 'Sivan'),
                /* I18N: a month in the Jewish calendar */
                11 => I18N::translateContext('NOMINATIVE', 'Tamuz'),
                /* I18N: a month in the Jewish calendar */
                12 => I18N::translateContext('NOMINATIVE', 'Av'),
                /* I18N: a month in the Jewish calendar */
                13 => I18N::translateContext('NOMINATIVE', 'Elul'),
            ];
        }

        if ($month === 7 && $leap_year) {
            return $translated_month_names[-7];
        }

        return $translated_month_names[$month];
    }