Handle RepeaterDayName RepeaterMonthName OrdinalDay
555218
def handle_rdn_rmn_od(tokens, options)
      month = tokens[1].get_tag(RepeaterMonthName)
      day = tokens[2].get_tag(OrdinalDay).type
      year = Chronic.now.year

      return if month_overflow?(year, month.index, day)

      begin
        start_time = Chronic.time_class.local(year, month.index, day)
        end_time = time_with_rollover(year, month.index, day + 1)
        Span.new(start_time, end_time)
      rescue ArgumentError
        nil
      end
    end
774422
def handleIncomingReply(self, observer_name, reqId, frm, result,
                            numReplies):
        
        preparedReq = self._prepared.get((result[IDENTIFIER], reqId))
        if not preparedReq:
            raise RuntimeError('no matching prepared value for {},{}'.
                               format(result[IDENTIFIER], reqId))
        typ = result.get(TXN_TYPE)
        if typ and typ in self.replyHandler:
            self.replyHandler[typ](result, preparedReq)
724332
def formatmonthname(self, theyear, themonth, withyear=True):
        """"""
        monthname = '%s %s' % (MONTHS[themonth].title(), theyear)
        return '<caption>%s</caption>' % monthname
870492
@JsonAnySetter
	public void handleJsonArrayToJavaString(String name, Object value) {

		try {
			PropertyUtils.setProperty(this, name,
					this.convertListToString(value));
		} catch (IllegalAccessException e) {
			log.debug("Error setting field " + name + " with value " + value
					+ " on entity " + this.getClass().getSimpleName());
			this.additionalProperties.put(name, value);
		} catch (InvocationTargetException e) {
			log.debug("Error setting field " + name + " with value " + value
					+ " on entity " + this.getClass().getSimpleName());
			this.additionalProperties.put(name, value);
		} catch (NoSuchMethodException e) {
			log.debug("Error setting field " + name + " with value " + value
					+ " on entity " + this.getClass().getSimpleName());
			this.additionalProperties.put(name, value);
		}

	}
1187074
function (dateStr) {
            var calendar = /**@type {KISSY.Date.Gregorian}
             @ignore*/
                new GregorianCalendar(this.timezoneOffset, this.locale), i, j, tmp = {}, obeyCount = false, dateStrLen = dateStr.length, errorIndex = -1, startIndex = 0, oldStartIndex = 0, pattern = this.pattern, len = pattern.length;
            loopPattern: {
                for (i = 0; errorIndex < 0 && i < len; i++) {
                    var comp = pattern[i], text, textLen;
                    oldStartIndex = startIndex;
                    if (text = comp.text) {
                        textLen = text.length;
                        if (textLen + startIndex > dateStrLen) {
                            errorIndex = startIndex;
                        } else {
                            for (j = 0; j < textLen; j++) {
                                if (text.charAt(j) !== dateStr.charAt(j + startIndex)) {
                                    errorIndex = startIndex;
                                    break loopPattern;
                                }
                            }
                            startIndex += textLen;
                        }
                    } else if ('field' in comp) {
                        obeyCount = false;
                        var nextComp = pattern[i + 1];
                        if (nextComp) {
                            if ('field' in nextComp) {
                                obeyCount = true;
                            } else {
                                var c = nextComp.text.charAt(0);
                                if (c >= '0' && c <= '9') {
                                    obeyCount = true;
                                }
                            }
                        }
                        startIndex = parseField(calendar, dateStr, startIndex, comp.field, comp.count, this.locale, obeyCount, tmp);
                        if (startIndex === oldStartIndex) {
                            errorIndex = startIndex;
                        }
                    }
                }
            }
            if (errorIndex >= 0) {
                logger.error('error when parsing date');
                logger.error(dateStr);
                logger.error(dateStr.substring(0, errorIndex) + '^');
                return undefined;
            }
            return calendar;
        }
834263
def handle_rdn_rmn_od(tokens, options)
      month = tokens[1].get_tag(RepeaterMonthName)
      day = tokens[2].get_tag(OrdinalDay).type
      time_tokens = tokens.last(tokens.size - 3)
      year = self.now.year

      return if month_overflow?(year, month.index, day)

      begin
        if time_tokens.empty?
          start_time = Chronic.time_class.local(year, month.index, day)
          end_time = time_with_rollover(year, month.index, day + 1)
          Span.new(start_time, end_time)
        else
          day_start = Chronic.time_class.local(year, month.index, day)
          day_or_time(day_start, time_tokens, options)
        end
      rescue ArgumentError
        nil
      end
    end
1016081
protected void handleName(
      EntityDesc entityDesc, EntityPropertyDesc propertyDesc, ColumnMeta columnMeta) {
    String name = StringUtil.fromSnakeCaseToCamelCase(columnMeta.getName());
    propertyDesc.setName(name);
  }
853989
function getCalendarMonth(moment, service, specialDaysService, dt) {
  var currentMonth = new service(moment, dt);
  var prevMonth = currentMonth.prevMonth();
  var nextMonth = currentMonth.nextMonth();
  var days = [];
  var daysCount = currentMonth.daysCount();
  var startDay = currentMonth.startDayOfMonth() - 1;
  var startNext = daysCount + startDay; // 31 -> 1

  var prev = prevMonth.daysCount() - startDay;
  var next = 1;
  var row = [];
  days.push(row);
  var maxCol = 7;
  var maxRow = 6;
  var cellCount = maxRow * maxCol;
  var localeDays = [];

  for (var i = 1; i <= cellCount; i++) {
    var isWeekend = false;
    var day = void 0;

    if (i <= startDay) {
      day = {
        day: ++prev,
        month: 'previous'
      };
      isWeekend = prevMonth.isWeekend(day.day);
      day.specialDay = specialDaysService(_objectSpread({}, prevMonth.fromDay(day.day).toNormalizedObject()));
      day.localeDay = prevMonth.localeDate().setDay(day.day).getDate().day;
    } else if (i > startNext) {
      day = {
        day: next++,
        month: 'next'
      };
      isWeekend = nextMonth.isWeekend(day.day);
      day.specialDay = specialDaysService(_objectSpread({}, nextMonth.fromDay(day.day).toNormalizedObject()));
      day.localeDay = nextMonth.localeDate().setDay(day.day).getDate().day;
    } else {
      day = {
        day: i - startDay,
        month: 'current'
      };
      isWeekend = currentMonth.isWeekend(day.day);
      day.specialDay = specialDaysService(_objectSpread({}, currentMonth.fromDay(day.day).toNormalizedObject()));
      day.localeDay = currentMonth.localeDate().setDay(day.day).getDate().day;
    }

    isWeekend && (day.isWeekend = isWeekend);
    row.push(day); // if(row.length === 1 || row.length === 7) {
    // }

    if (i > 0 && i % 7 == 0 && i !== cellCount) {
      row = [];
      days.push(row);
    }
  }

  return {
    // firstDayOfWeek: currentMonth.firstDayOfWeek(),
    longName: currentMonth.monthLong(),
    shortName: currentMonth.monthShort(),
    daysCount: currentMonth.daysCount(),
    startDayOfMonth: currentMonth.startDayOfMonth(),
    daysLong: currentMonth.weekdaysLong(),
    daysShort: currentMonth.weekdaysShort(),
    daysMin: currentMonth.weekdaysMin(),
    days: days,
    date: currentMonth.toObject(),
    localeDate: currentMonth.localeDate().getDate(),
    normalizedDate: currentMonth.toNormalizedObject(),
    previousMonth: {
      longName: prevMonth.monthLong(),
      shortName: prevMonth.monthShort(),
      daysCount: prevMonth.daysCount(),
      date: prevMonth.toObject(),
      normalizedDate: prevMonth.toNormalizedObject(),
      localeDate: prevMonth.localeDate().getDate()
    },
    nextMonth: {
      longName: nextMonth.monthLong(),
      shortName: nextMonth.monthShort(),
      daysCount: nextMonth.daysCount(),
      date: nextMonth.toObject(),
      normalizedDate: nextMonth.toNormalizedObject(),
      localeDate: nextMonth.localeDate().getDate()
    }
  };
}
880695
def handle_srp(tokens, span, options)
      distance = tokens[0].get_tag(Scalar).type
      repeater = tokens[1].get_tag(Repeater)
      pointer = tokens[2].get_tag(Pointer).type

      repeater.offset(span, distance, pointer) if repeater.respond_to?(:offset)
    end
660707
@UiHandler("m_atDay")
    void onWeekDayChange(ValueChangeEvent<String> event) {

        if (handleChange()) {
            m_controller.setWeekDay(event.getValue());
        }
    }
250565
protected static function getDayName($day, $shorten = false, $len = 1, $numeric = false) {
        
        switch (strtolower($day)) {
            case 'sat':
            case 'saturday':
                $name   = static::t('saturday');
                $number = 1;
                break;
            case 'sun':
            case 'sunday':
                $name   = static::t('sunday');
                $number = 2;
                break;
            case 'mon':
            case 'monday':
                $name   = static::t('monday');
                $number = 3;
                break;
            case 'tue':
            case 'tuesday':
                $name   = static::t('tuesday');
                $number = 4;
                break;
            case 'wed':
            case 'wednesday':
                $name   = static::t('wednesday');
                $number = 5;
                break;
            case 'thu':
            case 'thursday':
                $name   = static::t('thursday');
                $number = 6;
                break;
            case 'fri':
            case 'friday':
                $name   = static::t('friday');
                $number = 7;
                break;
            default:
                throw new InvalidArgumentException("'{$day}' is not a week day.");
        }
        
        return ($numeric) ? $number : (($shorten) ? mb_substr($name, 0, $len, 'UTF-8') : $name);
    }
369086
function initRepeaterActions () {
		var loadDelays = ['300', '600', '900', '1200'];

		var sort = function (data, sortProperty, sortDirection) {
			var sortedData = _.sortBy(data, function (item) {
				return item[sortProperty];
			});

			// sort direction
			if (sortDirection === 'desc') {
				sortedData = sortedData.reverse();
			}

			return sortedData;
		};

		function getSampleDataSet (options, callback) {
			var resp = {
				count: data.repeater.listData.length,
				items: [],
				page: options.pageIndex
			};

			// get start and end limits for JSON
			var i, l;
			resp.pages = Math.ceil(resp.count / (options.pageSize || 50));

			i = options.pageIndex * (options.pageSize || 50);
			l = i + (options.pageSize || 50);
			l = (l <= resp.count) ? l : resp.count;
			resp.start = i + 1;
			resp.end = l;

			// setup columns for list view
			resp.columns = [
				{
					label: 'Common Name',
					property: 'commonName',
					sortable: true
				},
				{
					label: 'Latin Name',
					property: 'latinName',
					sortable: true
				},
				{
					label: 'Appearance',
					property: 'appearance',
					sortable: true
				},
				{
					label: 'Sound',
					property: 'sound',
					sortable: true
				}
			];

			// add sample items to datasource
			for (i; i < l; i++) {
				// from data.js
				resp.items.push(data.repeater.listData[i]);
			}

			resp.items = sort(resp.items, options.sortProperty, options.sortDirection);

			// call and simulate latency
			setTimeout(function () {
				callback(resp);
			}, loadDelays[Math.floor(Math.random() * 4)]);

		}

		// initialize the repeater
		var repeaterActions = $('#myRepeaterActions');
		repeaterActions.repeater({
			list_noItemsHTML: '<span>foo</span>',
			list_highlightSortedColumn: true,
			list_selectable: 'multi',
			list_actions: {
				width: 37,
				items: [
					{
						name: 'edit',
						html: '<span class="glyphicon glyphicon-pencil"></span> Edit'
					},
					{
						name: 'copy',
						html: '<span class="glyphicon glyphicon-copy"></span> Copy'
					},
					{
						name: 'delete',
						html: '<span class="glyphicon glyphicon-trash"></span> Delete',
						clickAction: function (helpers, callback, e) {
							console.log('hey it worked');
							console.log(helpers);
							e.preventDefault();
							callback();
						}
					}
				]
			},
			// setup your custom datasource to handle data retrieval;
			// responsible for any paging, sorting, filtering, searching logic
			dataSource: getSampleDataSet
		});
	}
456280
function( name, actual, upper ) {
		var self = this,
			passed = false,
			message = '';

		if ( munit.isDate( actual ) && munit.isDate( upper ) ) {
			passed = actual.getTime() < upper.getTime();
			message = "Date '" + actual + "' is not before '" + upper + "'";
		}
		else {
			message = munit.isDate( actual ) ?
				"Upper value is not a Date object '" + upper + "'" :
				"Actual value is not a Date object '" + actual + "'";
		}

		return self.ok( name, passed, self.dateBefore, message );
	}
590378
private void processCalendars() throws SQLException, ParseException
   {
      List<Row> rows = getRows("select id as exceptionnid, * from exceptionn");
      Map<Integer, DayType> exceptionTypeMap = m_reader.createExceptionTypeMap(rows);

      rows = getRows("select id as work_patternid, name as namn, * from work_pattern");
      Map<Integer, Row> workPatternMap = m_reader.createWorkPatternMap(rows);

      rows = getRows("select id, work_patterns from calendar");
      Map<Integer, List<Row>> workPatternAssignmentMap = createWorkPatternAssignmentMap(rows);

      rows = getRows("select id, exceptions from calendar");
      Map<Integer, List<Row>> exceptionAssignmentMap = createExceptionAssignmentMap(rows);

      rows = getRows("select id, shifts from work_pattern");
      Map<Integer, List<Row>> timeEntryMap = createTimeEntryMap(rows);

      rows = getRows("select id as calendarid, name as namk, * from calendar where projid=? order by id", m_projectID);
      for (Row row : rows)
      {
         m_reader.processCalendar(row, workPatternMap, workPatternAssignmentMap, exceptionAssignmentMap, timeEntryMap, exceptionTypeMap);
      }

      //
      // Update unique counters at this point as we will be generating
      // resource calendars, and will need to auto generate IDs
      //
      m_reader.getProject().getProjectConfig().updateUniqueCounters();
   }
223187
def handle_s_r_p(tokens, options)
      repeater = tokens[1].get_tag(Repeater)
      span = Span.new(Chronic.now, Chronic.now + 1)

      handle_srp(tokens, span, options)
    end
151363
private function setDaysOfWeekNames() {
		
		if (empty($this->options['locale']['daysOfWeek'])) {
			$this->options['locale']['daysOfWeek'] = Yii::app()->locale->getWeekDayNames('narrow', true);
		}
	}
478773
private void readExceptionDay(ProjectCalendar mpxjCalendar, ExceptedDay day)
   {
      ProjectCalendarException mpxjException = mpxjCalendar.addCalendarException(day.getDate(), day.getDate());
      if (day.isIsDayWorking())
      {
         for (Document.Calendars.Calendar.ExceptedDays.ExceptedDay.TimePeriods.TimePeriod period : day.getTimePeriods().getTimePeriod())
         {
            mpxjException.addRange(new DateRange(period.getFrom(), period.getTo()));
         }
      }
   }