Converts a month by number to full text

@param month    number of the month 1..12
@param useShort boolean that gives "Jun" instead of "June" if true
@return returns "January" if "1" is given
775713
public static String convertMonth(int month, boolean useShort) {
        String monthStr;
        switch (month) {
            default:
                monthStr = "January";
                break;
            case Calendar.FEBRUARY:
                monthStr = "February";
                break;
            case Calendar.MARCH:
                monthStr = "March";
                break;
            case Calendar.APRIL:
                monthStr = "April";
                break;
            case Calendar.MAY:
                monthStr = "May";
                break;
            case Calendar.JUNE:
                monthStr = "June";
                break;
            case Calendar.JULY:
                monthStr = "July";
                break;
            case Calendar.AUGUST:
                monthStr = "August";
                break;
            case Calendar.SEPTEMBER:
                monthStr = "September";
                break;
            case Calendar.OCTOBER:
                monthStr = "October";
                break;
            case Calendar.NOVEMBER:
                monthStr = "November";
                break;
            case Calendar.DECEMBER:
                monthStr = "December";
                break;
        }
        if (useShort) monthStr = monthStr.substring(0, 3);
        return monthStr;
    }
326834
function SimpleDate(){
    this._monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
    this._monthNamesShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

    var tempDate = new Date();
    this.setYear(tempDate.getFullYear());
    this.setMonth(tempDate.getMonth());
    this.setDate(tempDate.getDate());

    if(arguments[0] != null) {
        if (arguments[0] instanceof Date) {
            tempDate = arguments[0];

            this.setYear(tempDate.getFullYear());
            this.setMonth(tempDate.getMonth());
            this.setDate(tempDate.getDate());
        } else if(arguments[0] instanceof SimpleDate) {
            this.setYear(arguments[0].getYear());
            this.setMonth(arguments[0].getMonth());
            this.setDate(arguments[0].getDate());
        } else if(arguments[0] instanceof Object) {
            var obj = arguments[0];
            if(obj.year != null && obj.month != null && obj.date != null) {
                this.setYear(obj.year);
                this.setMonth(obj.month);
                this.setDate(obj.date);
            } else {
                this.setYear(tempDate.getFullYear());
                this.setMonth(tempDate.getMonth());
                this.setDate(tempDate.getDate());
            }
        }else {
            try {
                this.setYear(parseInt(arguments[0]));
                this.setMonth(parseInt(arguments[1]));
                this.setDate(parseInt(arguments[2]));
            }catch(e) {
                this.setYear(tempDate.getFullYear());
                this.setMonth(tempDate.getMonth());
                this.setDate(tempDate.getDate());
            }
        }
    }
}
984823
public static function getMonthAsString($p_month, $p_lang, $p_html = true)
    {
        $month = '';
        switch ($p_lang) {
            case \FreeFW\Constants::LANG_FR:
                switch ($p_month) {
                    case 1:
                        $month = 'Janvier';
                        break;
                    case 2:
                        $month = 'Février';
                        break;
                    case 3:
                        $month = 'Mars';
                        break;
                    case 4:
                        $month = 'Avril';
                        break;
                    case 5:
                        $month = 'Mai';
                        break;
                    case 6:
                        $month = 'Juin';
                        break;
                    case 7:
                        $month = 'Juillet';
                        break;
                    case 8:
                        $month = 'Août';
                        break;
                    case 9:
                        $month = 'Septembre';
                        break;
                    case 10:
                        $month = 'Octobre';
                        break;
                    case 11:
                        $month = 'Novembre';
                        break;
                    case 12:
                        $month = 'Décembre';
                        break;
                }
                break;
            default:
                break;
        }
        if ($p_html) {
            return htmlentities($month);
        }
        return $month;
    }
651683
def end_of_month(val):
    
    if type(val) == date:
        val = datetime.fromordinal(val.toordinal())
    if val.month == 12:
        return start_of_month(val).replace(year=val.year + 1, month=1) \
               - timedelta(microseconds=1)
    else:
        return start_of_month(val).replace(month=val.month + 1) \
               - timedelta(microseconds=1)
839326
public static CalendarInterval fromYearMonthString(String s) throws IllegalArgumentException {
    CalendarInterval result = null;
    if (s == null) {
      throw new IllegalArgumentException("Interval year-month string was null");
    }
    s = s.trim();
    Matcher m = yearMonthPattern.matcher(s);
    if (!m.matches()) {
      throw new IllegalArgumentException(
        "Interval string does not match year-month format of 'y-m': " + s);
    } else {
      try {
        int sign = m.group(1) != null && m.group(1).equals("-") ? -1 : 1;
        int years = (int) toLongWithRange("year", m.group(2), 0, Integer.MAX_VALUE);
        int months = (int) toLongWithRange("month", m.group(3), 0, 11);
        result = new CalendarInterval(sign * (years * 12 + months), 0);
      } catch (Exception e) {
        throw new IllegalArgumentException(
          "Error parsing interval year-month string: " + e.getMessage(), e);
      }
    }
    return result;
  }
438418
function formatDate(date) {
  date = new Date(date);
  var monthNames = [
    'Jan',
    'Feb',
    'Mar',
    'Apr',
    'May',
    'June',
    'July',
    'Aug',
    'Sep',
    'Oct',
    'Nov',
    'Dec'
  ];
  return (
    monthNames[date.getMonth()] +
    ' ' +
    date.getDate() +
    ', ' +
    date.getFullYear()
  );
}
153259
public static Date beginOfMonth(@NotNull final Date date) {
		return DateUtils.truncate(date, Calendar.MONTH);
	}
668630
public static int getMonth(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.MONTH);
    }
159898
def unimonth!
      all_months_txt_rxs = MONTHS.map { |m| instance_variable_get("@#{m}".to_sym) }.join('|')
      @month_txt = Regexp.new("(?<month>#{all_months_txt_rxs})", true)
    end
53182
public boolean evaluateSprintLength(String startDate, String endDate, int maxKanbanIterationLength) {
		boolean sprintIndicator = false;
		Calendar startCalendar = Calendar.getInstance();
		Calendar endCalendar = Calendar.getInstance();

		if (!StringUtils.isAnyEmpty(startDate) && !StringUtils.isAnyEmpty(endDate)) {

			Date strDt = convertIntoDate(startDate.substring(0, 4) + "-" + startDate.substring(5, 7) + "-" + startDate.substring(8, 10), "yyyy-MM-dd" );
			Date endDt = convertIntoDate(endDate.substring(0, 4) + "-" + endDate.substring(5, 7) + "-" + endDate.substring(8, 10), "yyyy-MM-dd");

			if (strDt != null && endDate != null) {
				startCalendar.setTime(strDt);
				endCalendar.setTime(endDt);

				long diffMill = endCalendar.getTimeInMillis() - startCalendar.getTimeInMillis();
				long diffDays = TimeUnit.DAYS.convert(diffMill, TimeUnit.MILLISECONDS);

				if (diffDays <= maxKanbanIterationLength) {
					// Scrum-enough
					sprintIndicator = true;
				}
			}
		} else {
			// Default to kanban
			sprintIndicator = false;

		}

		return sprintIndicator;
	}
1292922
function month(options) {
    var content = ''
      , m = this.month;

    while(++m <= 12) {
      content += options.fn({
        month: m,
        selected: +this.expiration_month === m ? ' selected' : '',
        fullMonth: this.months[m - 1]
      });
    }

    return content;
  }
1272780
public XMLGregorianCalendar newGMonth(int month) {
        XMLGregorianCalendar cal=dataFactory.newXMLGregorianCalendar();
        cal.setMonth(month);
        return cal;
    }
286641
protected static function getMonthName($month, $shorten = false, $len = 3) {
        
        switch ((int) $month) {
            case 1:
                $name = static::t('farvardin');
                break;
            case 2:
                $name = static::t('ordibehesht');
                break;
            case 3:
                $name = static::t('khordad');
                break;
            case 4:
                $name = static::t('tir');
                break;
            case 5:
                $name = static::t('mordad');
                break;
            case 6:
                $name = static::t('shahrivar');
                break;
            case 7:
                $name = static::t('mehr');
                break;
            case 8:
                $name = static::t('aban');
                break;
            case 9:
                $name = static::t('azar');
                break;
            case 10:
                $name = static::t('dey');
                break;
            case 11:
                $name = static::t('bahman');
                break;
            case 12:
                $name = static::t('esfand');
                break;
            default:
                throw new InvalidArgumentException("'{$month}' is not a month name.");
        }
        
        return ($shorten) ? mb_substr($name, 0, $len, 'UTF-8') : $name;
    }
621625
public void setMonth(int month)
  {
    if (month < 0 || DAYS_IN_MONTH.length <= month)
      return;

    _month = month;

    if (DAYS_IN_MONTH[month] <= _dayOfMonth)
      _dayOfMonth = DAYS_IN_MONTH[month] - 1;

    calculateJoin();
    calculateSplit(_localTimeOfEpoch);
  }
1264731
def parse_month(text: str) -> int:
    ''''''
    text = text.lower()
    try:
        return MONTH_MAP[text]
    except KeyError:
        pass

    try:
        return MONTH_MAP[text[:3]]
    except KeyError:
        pass

    raise ValueError('Month {} not found.'.format(repr(text)))
588651
function(date, useLongName) {
				if (useLongName) {
					return (typeof monthNames === 'function') ?
						monthNames.call(calendar, date) :
						monthNames[date.month() - calendar.minMonth];
				} else {
					return (typeof monthNamesShort === 'function') ?
						monthNamesShort.call(calendar, date) :
						monthNamesShort[date.month() - calendar.minMonth];
				}
			}
964357
def verify_month(self, now):
        ''''''
        return self.month == "*" or str(now.month) in self.month.split(" ")