Return name(s) as a string based on given date and month.
        If no arguments given, use current date
185383
def get_nameday(self, month=None, day=None):
        """"""
        if month is None:
            month = datetime.now().month
        if day is None:
            day = datetime.now().day
        return self.NAMEDAYS[month-1][day-1]
1051627
public function getMonthName($month = null)
    {
        if ($month === null) {
            $month = $this->getMonth();
        }
        if ($month <= 0) {
            $month += count($this->monthNames);
        }

        $idx = $month - 1;

        return $this->monthNames[$idx];
    }
483230
def convert_date(date):
    """"""
    date = convert_month(date, shorten=False)
    clean_string = convert_string(date)
    return datetime.strptime(clean_string, DATE_FMT.replace('-',''))
616497
def format_date_string(self, date_tuple):
        
        months = ['', 'January', 'February', 'March', 'April', 'May', 'June',
                  'July', 'August', 'September', 'October', 'November', 'December']
        date_string = ''
        if date_tuple.season:
            return '{0}, {1}'.format(date_tuple.season, date_tuple.year)
        else:
            if not date_tuple.month and not date_tuple.day:
                return '{0}'.format(date_tuple.year)
            if date_tuple.month:
                date_string += months[int(date_tuple.month)]
            if date_tuple.day:
                date_string += ' ' + date_tuple.day
            return ', '.join([date_string, date_tuple.year])
401515
function formatDate(d, fmt, monthNames, dayNames) {

		if (typeof d.strftime == "function") {
			return d.strftime(fmt);
		}

		var leftPad = function(n, pad) {
			n = "" + n;
			pad = "" + (pad == null ? "0" : pad);
			return n.length == 1 ? pad + n : n;
		};

		var r = [];
		var escape = false;
		var hours = d.getHours();
		var isAM = hours < 12;

		if (monthNames == null) {
			monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
		}

		if (dayNames == null) {
			dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
		}

		var hours12;

		if (hours > 12) {
			hours12 = hours - 12;
		} else if (hours == 0) {
			hours12 = 12;
		} else {
			hours12 = hours;
		}

		for (var i = 0; i < fmt.length; ++i) {

			var c = fmt.charAt(i);

			if (escape) {
				switch (c) {
					case 'a': c = "" + dayNames[d.getDay()]; break;
					case 'b': c = "" + monthNames[d.getMonth()]; break;
					case 'd': c = leftPad(d.getDate()); break;
					case 'e': c = leftPad(d.getDate(), " "); break;
					case 'h':	// For back-compat with 0.7; remove in 1.0
					case 'H': c = leftPad(hours); break;
					case 'I': c = leftPad(hours12); break;
					case 'l': c = leftPad(hours12, " "); break;
					case 'm': c = leftPad(d.getMonth() + 1); break;
					case 'M': c = leftPad(d.getMinutes()); break;
					// quarters not in Open Group's strftime specification
					case 'q':
						c = "" + (Math.floor(d.getMonth() / 3) + 1); break;
					case 'S': c = leftPad(d.getSeconds()); break;
					case 'y': c = leftPad(d.getFullYear() % 100); break;
					case 'Y': c = "" + d.getFullYear(); break;
					case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
					case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
					case 'w': c = "" + d.getDay(); break;
				}
				r.push(c);
				escape = false;
			} else {
				if (c == "%") {
					escape = true;
				} else {
					r.push(c);
				}
			}
		}

		return r.join("");
	}
1234703
public static function getMonthFullname($month)
    {
        $month = (int) $month;
        $names = self::getMonthNames();
        return $names[$month];
    }
1042871
def displayName(date, options=None, format='%b %d, %Y'):
    
    # map from Qt information
    if type(date).__name__ in ('QDate', 'QDateTime', 'QTime'):
        date = date.toPython()

    if isinstance(date, datetime.datetime):
        time = ' @ ' + date.strftime('%I:%M%p').strip('0M').lower()
        date = date.date()
    else:
        time = ''

    today = datetime.date.today()
    delta = date - today

    if delta.days == 0:
        return 'Today' + time
    elif delta.days == -1:
        return 'Yesterday' + time
    elif delta.days == 1:
        return 'Tomorrow' + time
    elif abs(delta.days) < 8:
        # look for different weeks
        if date.isocalendar()[1] != today.isocalendar()[1]:
            qualifier = 'Last ' if delta.days < 0 else 'Next '
        else:
            qualifier = ''

        return qualifier + date.strftime('%A') + time
    else:
        return date.strftime(format)
1334859
def convert_month(date, shorten=True, cable=True):
    
    month = date.split()[0].lower()
    if 'sept' in month:
        shorten = False if cable else True

    try:
        if shorten:
            month = SHORT_MONTHS[MONTHS.index(month)]
        else:
            month = MONTHS[SHORT_MONTHS.index(month)]
    except ValueError:
        month = month.title()

    return '{0} {1}'.format(month, ' '.join(date.split()[1:]))
1338786
def output_date(datetime, output_date: :abbr, output_date_length: :month,
			**opts)
			lang=opts[:lang]||:en
			year,month,day,time=split_date(datetime)
			month=nil if output_date_length==:year
			day=nil if output_date_length==:month
			time=nil if output_date_length==:day
			return Formatter.localize({en: 'Present', fr: 'Présent'},**opts) if datetime==:now
			r=year
			case output_date
			when :num
				month.nil? ? (return r) : r+="-"+month
				day.nil? ? (return r) : r+="-"+day
				time.nil? ? (return r) : r+="T"+time
			when :abbr,:string
				return r if month.nil?
				month_name=Months_names[lang][month.to_i]
				month_name=abbr_month(month_name) if output_date==:abbr
				r=month_name+" "+r
				return r if day.nil?
				r=day+" "+r
				return r if time.nil?
				r+=" "+time
			end
			r
		end
1011638
function getDateTranslation(date, locale, name, width, form, extended) {
    switch (name) {
        case TranslationType.Months:
            return getLocaleMonthNames(locale, form, width)[date.getMonth()];
        case TranslationType.Days:
            return getLocaleDayNames(locale, form, width)[date.getDay()];
        case TranslationType.DayPeriods:
            var /** @type {?} */ currentHours_1 = date.getHours();
            var /** @type {?} */ currentMinutes_1 = date.getMinutes();
            if (extended) {
                var /** @type {?} */ rules = getLocaleExtraDayPeriodRules(locale);
                var /** @type {?} */ dayPeriods_1 = getLocaleExtraDayPeriods(locale, form, width);
                var /** @type {?} */ result_1;
                rules.forEach(function (rule, index) {
                    if (Array.isArray(rule)) {
                        // morning, afternoon, evening, night
                        var _a = rule[0], hoursFrom = _a.hours, minutesFrom = _a.minutes;
                        var _b = rule[1], hoursTo = _b.hours, minutesTo = _b.minutes;
                        if (currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom &&
                            (currentHours_1 < hoursTo ||
                                (currentHours_1 === hoursTo && currentMinutes_1 < minutesTo))) {
                            result_1 = dayPeriods_1[index];
                        }
                    }
                    else {
                        // noon or midnight
                        var hours = rule.hours, minutes = rule.minutes;
                        if (hours === currentHours_1 && minutes === currentMinutes_1) {
                            result_1 = dayPeriods_1[index];
                        }
                    }
                });
                if (result_1) {
                    return result_1;
                }
            }
            // if no rules for the day periods, we use am/pm by default
            return getLocaleDayPeriods(locale, form, /** @type {?} */ (width))[currentHours_1 < 12 ? 0 : 1];
        case TranslationType.Eras:
            return getLocaleEraNames(locale, /** @type {?} */ (width))[date.getFullYear() <= 0 ? 0 : 1];
    }
}
820484
function (monthStr) {
			var mon = (monthStr && monthStr.toLowerCase());
			return _.isString(mon) && (map[mon] || map[mon.substr(0,3)]);
		}
1032817
function getDateString() {
  const d = new Date();
  const year = `${d.getFullYear()}`;
  let month = `${d.getMonth() + 1}`;
  let day = `${d.getDate()}`;
  if (month.length < 2) {
    month = `0${month}`;
  }
  if (day.length < 2) {
    day = `0${day}`;
  }
  let hour = `${d.getHours()}`;
  if (hour.length < 2) {
    hour = `0${hour}`;
  }
  let minute = `${d.getMinutes()}`;
  if (minute.length < 2) {
    minute = `0${minute}`;
  }
  let second = `${d.getSeconds()}`;
  if (second.length < 2) {
    second = `0${second}`;
  }
  return `${year}-${month}-${day}T${hour}.${minute}.${second}`;
}
223489
function(val, options){
				var names;
				var p = val.split('-');
				if(p[0] && p[1]){

					if(!options || !options.monthSelect){
						names = curCfg.date[options.monthNames] || curCfg.date.monthNames;
						p[1] = names[(p[1] * 1) - 1];
					}

					if(options && options.splitInput){
						val = [p[0] || '', p[1] || ''];
					} else if(p[1]){
						val = curCfg.date.showMonthAfterYear ? p.join(' ') : p[1]+' '+p[0];
					}
				} else if(options && options.splitInput){
					val = [p[0] || '', p[1] || ''];
				}
				return val;
			}
1354884
def check_months(text):
    """"""
    err = "MAU102"
    msg = "Months should be capitalized. '{}' is the preferred form."

    list = [

        ["January",         ["january"]],
        ["February",        ["february"]],
        # ["March",           ["march"]],
        ["April",           ["april"]],
        # ["May",             ["may"]],
        ["June",            ["june"]],
        ["July",            ["july"]],
        ["August",          ["august"]],
        ["September",       ["september"]],
        ["October",         ["october"]],
        ["November",        ["november"]],
        ["December",        ["december"]],
    ]

    return preferred_forms_check(text, list, err, msg, ignore_case=False)
1114728
def get_name_on_date(self, date):
        
        if date is None:
            return self.name

        post_name_changes = CompanyNameChange.objects.filter(company=self,
                                                             date__gte=date).order_by('date')
        if post_name_changes.count() == 0:
            return self.name
        else:
            return post_name_changes[0].name_before
723548
function(str) {
    var path = require('path');
    var name = path.basename(str, path.extname(str));
    var re = /(\d{4})-(\d{2})-(\d{2})-(.+)/;
    // $1 = yyyy, $2 = mm, $3 = dd, $4 = basename
    return name.replace(re, '$4');
  }
770779
def date_key(cls, month_string):
		
		month, year = month_string.split(',')
		month_ord = cls.month_ordinal[month]
		return year, month_ord