/*[deutsch]
<p>Liefert den republikanischen Monat, wenn vorhanden. </p>

@return  month enum
@throws  ChronoException if this date is a complementary day
@see     #MONTH_OF_YEAR
@see     #hasSansculottides()
@see     #hasMonth()
323576
public FrenchRepublicanMonth getMonth() {

        if (this.fdoy > 360) {
            throw new ChronoException(
                "Complementary days (sansculottides) do not represent any month: " + this.toString());
        }

        int m = ((this.fdoy - 1) / 30) + 1;
        return FrenchRepublicanMonth.valueOf(m);

    }
292136
function getPeriodoSala (periodo) {
  assert.ok(typeof periodo === 'number' || periodo instanceof Date, '[senadores-asistencia]: El periodo ingresado debe ser un número o una fecha.')

  let _period = {}
  if (typeof periodo === 'number') {
    _period = periods.filter(period => period.legislatura === periodo)
    // search directly by period id
    if (_period.length > 0) return _period[0]
    // search only by year
    _period = periods.filter(period => {
      return period.desde.getFullYear() <= periodo && periodo <= period.hasta.getFullYear()
    })[0]
    assert.ok(_period, '[senadores-asistencia]: Periodo de busqueda no encontrado')
    console.warn('[senadores-asistencia]: Solo se puede consultar por periodo legislativo. Si para un mismo año existe más de un periodo legislativo, solo se obtendran los resultados del primer periodo encontrado, por lo que jamas se obtendran los periodos posteriores en caso de existir. Prefiera busquedas por fecha o id de legislatura.')
    return _period
  }
  if (periodo instanceof Date) {
    // search by date
    _period = periods.filter(period => {
      return period.desde.getTime() <= periodo.getTime() && periodo.getTime() <= period.hasta.getTime()
    })[0]
    assert.ok(_period, '[senadores-asistencia]: Periodo de busqueda no encontrado')
    return _period
  }
}
513105
public PeriodFormatter getPeriodFormatter() {
    if (formatter == null) {
      formatter = ps.newPeriodFormatterFactory()
          .setLocale(localeName)
          .getFormatter();
    }
    return formatter;
  }
1057986
public static AnnualDate of(
        int month,
        int dayOfMonth
    ) {

        check(month, dayOfMonth);
        return new AnnualDate(month, dayOfMonth);

    }
368263
public function quarterly()
    {
        $months = [Month::JANUARY, Month::APRIL, Month::JULY, Month::OCTOBER];
        $this->setScheduleMonth($this->parseTimeParameter($months));
        $this->setScheduleWeek(self::NONE);
        $this->setScheduleDayOfMonth(1);
        $this->setScheduleDayOfWeek(self::ANY);
        $this->setScheduleHour(0);
        $this->setScheduleMinute(0);

        return $this;
    }
385219
public static function getSchedulePeriod()
    {
        $period = Option::get(self::SCHEDULE_PERIOD_OPTION_NAME);
        if ($period === false) {
            $period = self::SCHEDULE_PERIOD_MONTHLY;
        }
        return $period;
    }
222096
public function getMonthNamesNarrow($month = null)
    {
        $calendar = $this->getName();
        // gregorian, generic

        $data = array();
        $calendsFallback = array($calendar, 'gregorian', 'generic');
        foreach ($calendsFallback as $calendar) {
            $data = $this->getRepoReader()->getEntityByPath(
                'dates/calendars/calendar[@type="'.$calendar.'"]/months/monthContext[@type="format"]/monthWidth[@type="abbreviated"]/month'
            );

            if ($data) {
                break;
            }
        }

        $months = array();
        foreach($data as $d) {
            $months[$d['type']] = $d['value'];
        }

        $return = ($month == null) ? $months : false;

        return isset($months[$month]) ? $months[$month] : $return;
    }
360907
static DayPeriod of(
        Locale locale,
        String calendarType
    ) {

        String lang = locale.getLanguage(); // NPE-check

        if (lang.equals("nn")) {
            locale = new Locale("nb"); // CLDR 29 contains no data for language nn
        }

        Map<String, String> resourceMap = loadTextForms(locale, calendarType);
        SortedMap<PlainTime, String> codeMap = Collections.emptySortedMap();

        for (String key : resourceMap.keySet()) {
            if (accept(key)) {
                int hour = Integer.parseInt(key.substring(1, 3));
                int minute = Integer.parseInt(key.substring(3, 5));
                PlainTime time = PlainTime.midnightAtStartOfDay();
                if (hour == 24) {
                    if (minute != 0) {
                        throw new IllegalStateException("Invalid time key: " + key);
                    }
                } else if ((hour >= 0) && (hour < 24) && (minute >= 0) && (minute < 60)) {
                    time = time.plus(hour * 60 + minute, ClockUnit.MINUTES);
                } else {
                    throw new IllegalStateException("Invalid time key: " + key);
                }
                if (codeMap.isEmpty()) {
                    codeMap = new TreeMap<>();
                }
                codeMap.put(time, resourceMap.get(key));
            }
        }

        if (codeMap.isEmpty() || lang.isEmpty()) {
            return FALLBACK;
        }

        Iterator<PlainTime> iter = codeMap.keySet().iterator();
        String oldCode = "";

        while (iter.hasNext()) {
            PlainTime time = iter.next();
            String code = codeMap.get(time);
            if (code.equals(oldCode)) {
                iter.remove(); // lex colombia
            } else {
                oldCode = code;
            }
        }

        return new DayPeriod(locale, calendarType, codeMap);

    }
603847
protected function formatMonthZeros(): string
    {
        if ($this->month > 9) {
            return I18N::digits($this->month);
        }

        return I18N::digits('0' . $this->month);
    }
540163
public function getFrenchMonths() {
        $months = array(
            1 => 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'
        );
        return $months;
    }
766853
public static <T> Chronology<T> lookup(Class<T> chronoType) {

        try {
            // Initialisierung der Klasse anstoßen, wenn noch nicht erfolgt
            Class.forName(
                chronoType.getName(),
                true,
                chronoType.getClassLoader());
        } catch (ClassNotFoundException cnfe) {
            throw new IllegalStateException(cnfe);
        }

        Chronology<?> ret = null;
        boolean purged = false;

        for (ChronoReference cref : CHRONOS) {
            Chronology<?> chronology = cref.get();

            if (chronology == null) {
                purged = true;
            } else if (chronology.getChronoType() == chronoType) {
                ret = chronology;
                break;
            }
        }

        if (purged) {
            purgeQueue();
        }

        return cast(ret); // type-safe

    }
78318
protected function getMonths()
    {
        $intSecondsPerMonth = ($this->isPositive()) ? DateTimeSpan::SECONDS_PER_MONTH : ((-1) * DateTimeSpan::SECONDS_PER_MONTH);
        $intMonths = floor($this->intSeconds / $intSecondsPerMonth);
        if ($this->isNegative()) {
            $intMonths = (-1) * $intMonths;
        }
        return $intMonths;
    }
1303817
protected function getMonth()
    {
        $arrMonth = array();
        $objMonth = \Database::getInstance()->prepare("SELECT
                                                         FROM_UNIXTIME(`tstamp`,'%Y-%m')  AS YM
                                                       , COUNT(`id`) AS SUMDL
                                                       FROM `tl_dlstatdets`
                                                       WHERE 1
                                                       GROUP BY YM
                                                       ORDER BY YM DESC")
                                            ->limit(12)
                                            ->execute();
        $intRows = $objMonth->numRows;
        if ($intRows>0)
        {
            while ($objMonth->next())
            {
                $Y = substr($objMonth->YM, 0,4);
                $M = (int)substr($objMonth->YM, -2);
                $arrMonth[] = array($Y.' '.$GLOBALS['TL_LANG']['MONTHS'][($M - 1)], $this->getFormattedNumber($objMonth->SUMDL,0) );
            }
        }

        return $arrMonth;
    }
1087078
@Nonnegative
  public static java.time.Month getMonth (@Nonnull final Month eMonth)
  {
    switch (eMonth)
    {
      case JANUARY:
        return java.time.Month.JANUARY;
      case FEBRUARY:
        return java.time.Month.FEBRUARY;
      case MARCH:
        return java.time.Month.MARCH;
      case APRIL:
        return java.time.Month.APRIL;
      case MAY:
        return java.time.Month.MAY;
      case JUNE:
        return java.time.Month.JUNE;
      case JULY:
        return java.time.Month.JULY;
      case AUGUST:
        return java.time.Month.AUGUST;
      case SEPTEMBER:
        return java.time.Month.SEPTEMBER;
      case OCTOBER:
        return java.time.Month.OCTOBER;
      case NOVEMBER:
        return java.time.Month.NOVEMBER;
      case DECEMBER:
        return java.time.Month.DECEMBER;
      default:
        throw new IllegalArgumentException ("Unknown month " + eMonth);
    }
  }
1321532
public function getPeriods2()
  {
    $periods = array();

    $this->Period->byOrganizationWithYear($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($Period) use (&$periods)
    {
      // array_push($periods, array('value'=> $Period->id, 'label' => $this->Lang->get('decima-accounting::period-management.' . $Period->month) . ' ' . $Period->year->year));
      array_push($periods, array('value'=> $Period->id, 'label' => $this->Lang->get('decima-accounting::period-management.' . $Period->month) . ' ' . $Period->year));
    });

    return $periods;
  }
1288542
public String getDate() {
        SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
        String date = formatter.format(calendar.getTime());

        return date;
    }
240053
public function monthly()
    {
        $this->setScheduleMonth(self::ANY);
        $this->setScheduleWeek(self::NONE);
        $this->setScheduleDayOfMonth(1);
        $this->setScheduleDayOfWeek(self::ANY);
        $this->setScheduleHour(0);
        $this->setScheduleMinute(0);

        return $this;
    }