Returns an array of month names (short and long) translated to the site language

JavaScript Date object does not have a public API to do this.

@param array $config
@return string
14104
public function local_dates($config = array())
    {
        $html   = '';
        $months = array();

        $translator = $this->getObject('translator');

        for ($i = 1; $i < 13; $i++)
        {
            $month  = strtoupper(date('F', mktime(0, 0, 0, $i, 1, 2000)));
            $long  = $translator->translate($month);
            $short = $translator->translate($month.'_SHORT');

            if (strpos($short, '_SHORT') !== false) {
                $short = $long;
            }

            $months[$i] = array('long' => $long, 'short' => $short);
        }

        if (!static::isLoaded('local_dates'))
        {
            $html = sprintf("
            <script>
            if(!Koowa) {
                var Koowa = {};
            }

            if (!Koowa.Date) {
                Koowa.Date = {};
            }

            Koowa.Date.local_month_names = %s;
            Koowa.Date.getMonthName = function(month, short) {
                month = parseInt(month, 10);

                if (month < 1 || month > 12) {
                    throw 'Month index should be between 1 and 12';
                }

                return Koowa.Date.local_month_names[month][short ? 'short' : 'long'];
            };
            </script>
            ", json_encode($months));

            static::setLoaded('local_dates');
        }

        return $html;
    }
228576
public function getTemplate(array $config)
	{
		foreach ($this->templateGenerators as $type => $generator)
		{
			if (isset($config[$type]))
			{
				return $generator->getTemplate($config[$type]);
			}
		}

		return '';
	}
1371734
public static function getLocalMonthName($date, $short=false) {
		if(empty($date))
			return false;
		
		$month = date('m', strtotime($date));

		$bulan = array('Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember');
		$shortBulan = array('Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des');

		if($short == true)
			return $shortBulan[$month-1];
		else
			return $bulan[$month-1];
	}
166839
static public function config($config = array())
    {
        !empty($config) && self::$config = array_merge(self::$config, $config);
        if (!empty(self::$config['cachepath'])) {
            Cache::$cachepath = self::$config['cachepath'];
        }
        if (empty(self::$config['component_verify_ticket'])) {
            self::$config['component_verify_ticket'] = Cache::get('component_verify_ticket');
        }
        if (empty(self::$config['token']) && !empty(self::$config['component_token'])) {
            self::$config['token'] = self::$config['component_token'];
        }
        if (empty(self::$config['appsecret']) && !empty(self::$config['component_appsecret'])) {
            self::$config['appsecret'] = self::$config['component_appsecret'];
        }
        if (empty(self::$config['encodingaeskey']) && !empty(self::$config['component_encodingaeskey'])) {
            self::$config['encodingaeskey'] = self::$config['component_encodingaeskey'];
        }
        return self::$config;
    }
540163
public function getFrenchMonths() {
        $months = array(
            1 => 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'
        );
        return $months;
    }
282260
protected function getValues( array $config )
	{
		$values = array(
			'package' => 'Aimeos.Shop',
			'subpackage' => null,
			'absoluteUri' => false,
			'format' => 'html',
		);

		if( isset( $config['package'] ) ) {
			$values['package'] = (string) $config['package'];
		}

		if( isset( $config['subpackage'] ) ) {
			$values['subpackage'] = (string) $config['subpackage'];
		}

		if( isset( $config['absoluteUri'] ) ) {
			$values['absoluteUri'] = (bool) $config['absoluteUri'];
		}

		if( isset( $config['format'] ) ) {
			$values['format'] = (string) $config['format'];
		}

		return $values;
	}
1077916
public function humanize($config = array())
    {
        $config = new KObjectConfig($config);
        $config->append(array(
            'date'      => 'now',
            'timezone'  => date_default_timezone_get(),
            'default'   => $this->getObject('translator')->translate('Never'),
            'period'    => 'second',

        ));

        $result = $config->default;

        if(!in_array($config->date, array('0000-00-00 00:00:00', '0000-00-00')))
        {
            try
            {
                $date = $this->getObject('date', array('date' => $config->date, 'timezone' => 'UTC'));
                $date->setTimezone(new DateTimeZone($config->timezone));

                $result = $date->humanize($config->period);
            }
            catch(Exception $e) {}
        }
        return $result;
    }
318675
public function message($config) : string
  {
    $config = $this->cleanString($config);
    return json_encode(config($config));
  }
1028066
public function timezones($config = array())
    {
        $config = new ObjectConfig($config);
        $config->append(array(
            'name'      => 'timezone',
            'attribs'   => array(),
            'deselect'  => true,
            'prompt'    => '- '.$this->getObject('translator')->translate('Select Time Zone').' -',
        ));

        if ($config->deselect) {
            $options[] = $this->option(array('label' => $config->prompt, 'value' => ''));
        }

        foreach (\DateTimeZone::listIdentifiers() as $identifier)
        {
            if (strpos($identifier, '/'))
            {
                list($group, $locale) = explode('/', $identifier, 2);
                $groups[$group][] = str_replace('_', ' ', $locale);
            }
        }

        $options[] = $this->option(array('label' => 'Coordinated Universal Time', 'value' => 'UTC'));
        foreach ($groups as $group => $locales)
        {
            foreach ($locales as $locale) {
                $options[$group][] = $this->option(array('label' => $locale, 'value' => str_replace(' ', '_', $group.'/'.$locale)));
            }
        }

        $list = $this->optionlist(array(
            'options'   => $options,
            'name'      => $config->name,
            'selected'  => $config->selected,
            'attribs'   => $config->attribs
        ));

        return $list;
    }
1234703
public static function getMonthFullname($month)
    {
        $month = (int) $month;
        $names = self::getMonthNames();
        return $names[$month];
    }
1364216
public function format($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'date'     => 'now',
            'timezone' => true,
            'format'   => $this->getObject('translator')->translate('DATE_FORMAT_LC3')
        ));

        return JHtml::_('date', $config->date, $config->format, $config->timezone);
    }
1257977
public function message(array $config): string
    {
        if ($this->databaseError !== null) {
            return trans('self-diagnosis::checks.migrations_are_up_to_date.message.unable_to_check', [
                'reason' => $this->databaseError,
            ]);
        }
        return trans('self-diagnosis::checks.migrations_are_up_to_date.message.need_to_migrate');
    }
1352428
def get_i18n_month_name(month_nb, display='short', ln=None):
    
    ln = default_ln(ln)
    _ = gettext_set_language(ln)
    if display == 'short':
        months = {0: _("Month"),
                  1: _("Jan"),
                  2: _("Feb"),
                  3: _("Mar"),
                  4: _("Apr"),
                  5: _("May"),
                  6: _("Jun"),
                  7: _("Jul"),
                  8: _("Aug"),
                  9: _("Sep"),
                  10: _("Oct"),
                  11: _("Nov"),
                  12: _("Dec")}
    else:
        months = {0: _("Month"),
                  1: _("January"),
                  2: _("February"),
                  3: _("March"),
                  4: _("April"),
                  5: _("May "),  # trailing space distinguishes short/long form
                  6: _("June"),
                  7: _("July"),
                  8: _("August"),
                  9: _("September"),
                  10: _("October"),
                  11: _("November"),
                  12: _("December")}
    return months[month_nb].strip()
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));
    }
270967
function (lang) {
        if (lang == "es") {
            monthsAbbr = [
                'Ene',
                'Feb',
                'Mar',
                'Abr',
                'May',
                'Jun',
                'Jul',
                'Ago',
                'Sep',
                'Oct',
                'Nov',
                'Dic'
            ];

            monthsFull = [
                'Enero',
                'Febrero',
                'Marzo',
                'Abril',
                'Mayo',
                'Junio',
                'Julio',
                'Agosto',
                'Septiembre',
                'Octubre',
                'Noviembre',
                'Diciembre'
            ];

            daysAbbr = [
                'Dom',
                'Lun',
                'Mar',
                'Mie',
                'Jue',
                'Vie',
                'Sab'
            ];

            daysFull = [
                'Domingo',
                'Lunes',
                'Martes',
                'Miércoles',
                'Jueves',
                'Viernes',
                'Sábado'
            ];

            dayNames = {
                'do': 0,
                'dom': 0,
                'domingo': 0,
                'lu': 1,
                'lun': 1,
                'lunes': 1,
                'ma': 2,
                'mar': 2,
                'martes': 2,
                'mi': 3,
                'mie': 3,
                'miercoles': 3,
                'ju': 4,
                'jue': 4,
                'jueves': 4,
                'vi': 5,
                'vie': 5,
                'viernes': 5,
                'sa': 6,
                'sab': 6,
                'sabado': 6
            };
            monthsAll = monthsFull.concat(monthsAbbr);
            daysAll = [
                'do',
                'dom',
                'domingo',
                'lu',
                'lun',
                'lunes',
                'ma',
                'mar',
                'martes',
                'mi',
                'mie',
                'miércoles',
                'ju',
                'jue',
                'jueves',
                'vi',
                'vie',
                'viernes',
                'sa',
                'sab',
                'sábado'
            ];

            monthNames = {
                'ene': 0,
                'enero': 0,
                'feb': 1,
                'febrero': 1,
                'mar': 2,
                'marzo': 2,
                'abr': 3,
                'abril': 3,
                'may': 4,
                'mayo':4,
                'jun': 5,
                'junio': 5,
                'jul': 6,
                'julio': 6,
                'ago': 7,
                'agosto': 7,
                'sep': 8,
                'septiembre': 8,
                'oct': 9,
                'octubre': 9,
                'nov': 10,
                'noviembre': 10,
                'dic': 11,
                'diciembre': 11
            };
        } else if (lang == "fr") {
            monthsAbbr = [
                'Jan',
                'Fév',
                'Mar',
                'Avr',
                'Mai',
                'Jui',
                'Jul',
                'Aoû',
                'Sep',
                'Oct',
                'Nov',
                'Déc'
            ];

            monthsFull = [
                'Janvier',
                'Février',
                'Mars',
                'Avril',
                'Mai',
                'Juin',
                'Juillet',
                'Août',
                'Septembre',
                'Octobre',
                'Novembre',
                'Décembre'
            ];

            daysAbbr = [
                'Dim',
                'Lun',
                'Mar',
                'Mer',
                'Jeu',
                'Ven',
                'Sam'
            ];

            daysFull = [
                'Dimanchi',
                'Lundi',
                'Mardi',
                'Mercredi',
                'Jeudi',
                'Vendredi',
                'Samedi'
            ];

            dayNames = {
                'di': 0,
                'dim': 0,
                'dimanchi': 0,
                'lu': 1,
                'lun': 1,
                'lundi': 1,
                'ma': 2,
                'mar': 2,
                'mardi': 2,
                'me': 3,
                'mer': 3,
                'mercredi': 3,
                'je': 4,
                'jeu': 4,
                'jeudi': 4,
                've': 5,
                'ven': 5,
                'vendredi': 5,
                'sa': 6,
                'sam': 6,
                'samedi': 6
            };
            monthsAll = monthsFull.concat(monthsAbbr);
            daysAll = [
                'di',
                'dim',
                'dimanchi',
                'lu',
                'lun',
                'lundi',
                'ma',
                'mar',
                'mardi',
                'me',
                'mer',
                'mercredi',
                'je',
                'jeu',
                'jeudi',
                've',
                'ven',
                'vendredi',
                'sa',
                'sam',
                'samedi'
            ];

            monthNames = {
                'jan': 0,
                'janvier': 0,
                'fév': 1,
                'février': 1,
                'mar': 2,
                'mars': 2,
                'avr': 3,
                'avril': 3,
                'mai': 4,
                'jui': 5,
                'juin': 5,
                'jul': 6,
                'juillet': 6,
                'aoû': 7,
                'août': 7,
                'sep': 8,
                'septembre': 8,
                'oct': 9,
                'octobre': 9,
                'nov': 10,
                'novembre': 10,
                'déc': 11,
                'décembre': 11
            };
        } else if (lang == "pt-BR") {
            monthsAbbr = [
                'Jan',
                'Fev',
                'Mar',
                'Abr',
                'Mai',
                'Jun',
                'Jul',
                'Ago',
                'Set',
                'Out',
                'Nov',
                'Dez'
            ];

            monthsFull = [
                'Janeiro',
                'Fevereiro',
                'Março',
                'Abril',
                'Maio',
                'Junho',
                'Julho',
                'Agosto',
                'Setembro',
                'Outubro',
                'Novembro',
                'Dezembro'
            ];

            daysAbbr = [
                'Dom',
                'Seg',
                'Ter',
                'Qua',
                'Qui',
                'Sex',
                'Sab'
            ];

            daysFull = [
                'Domingo',
                'Segunda',
                'Terça',
                'Quarta',
                'Quinta',
                'Sexta',
                'Sábado'
            ];

            dayNames = {
                'do': 0,
                'dom': 0,
                'domingo': 0,
                'se': 1,
                'seg': 1,
                'segunda': 1,
                'te': 2,
                'ter': 2,
                'terca': 2,
                'qa': 3,
                'qua': 3,
                'quarta': 3,
                'qi': 4,
                'qui': 4,
                'quinta': 4,
                'se': 5,
                'sex': 5,
                'sexta': 5,
                'sa': 6,
                'sab': 6,
                'sabado': 6
            };
            monthsAll = monthsFull.concat(monthsAbbr);
            daysAll = [
                'do',
                'dom',
                'domingo',
                'se',
                'seg',
                'segunda',
                'te',
                'ter',
                'terça',
                'qa',
                'qua',
                'quarta',
                'qi',
                'qui',
                'quinta',
                'se',
                'sex',
                'sexta',
                'sa',
                'sab',
                'sábado'
            ];

            monthNames = {
                'jan': 0,
                'janeiro': 0,
                'fev': 1,
                'fevereiro': 1,
                'mar': 2,
                'março': 2,
                'abr': 3,
                'abril': 3,
                'mai': 4,
                'jun': 5,
                'junho': 5,
                'jul': 6,
                'julho': 6,
                'ago': 7,
                'agosto': 7,
                'set': 8,
                'setembro': 8,
                'out': 9,
                'outubro': 9,
                'nov': 10,
                'novembro': 10,
                'dez': 11,
                'dezembro': 11
            };
        }
    }
536247
function monthname($month)

	{



		if($month=="01") return "فروردین";



		if($month=="02") return "اردیبهشت";



		if($month=="03") return "خرداد";



		if($month=="04") return  "تیر";



		if($month=="05") return "مرداد";



		if($month=="06") return "شهریور";



		if($month=="07") return "مهر";



		if($month=="08") return "آبان";



		if($month=="09") return "آذر";



		if($month=="10") return "دی";



		if($month=="11") return "بهمن";



		if($month=="12") return "اسفند";

	}
656575
function get_month_shortname($m="") {
  	if ($m=="") {
  		$m = $this->mdate("m");
 		}
		$dt = \DateTime::createFromFormat('!m', $m);
		return $dt->format('M');
 	}