Maps given WeekDay to representation hold by this instance.

@param targetWeekDayDefinition - referred weekDay
@param dayOfWeek               - day of week to be mapped.
Value corresponds to this instance mapping.
@return - int result
339309
public int mapTo(final int dayOfWeek, final WeekDay targetWeekDayDefinition) {
        if (firstDayZero && targetWeekDayDefinition.isFirstDayZero()) {
            return bothSameStartOfRange(0, 6, this, targetWeekDayDefinition).apply(dayOfWeek);
        }
        if (!firstDayZero && !targetWeekDayDefinition.isFirstDayZero()) {
            return bothSameStartOfRange(1, 7, this, targetWeekDayDefinition).apply(dayOfWeek);
        }
        //start range is different for each case. We need to normalize ranges
        if (targetWeekDayDefinition.isFirstDayZero()) {
            //my range is 1-7. I normalize ranges, get the "zero" mapping and turn result into original scale
            return mapTo(dayOfWeek, new WeekDay(targetWeekDayDefinition.getMondayDoWValue() + 1, false)) - 1;
        } else {
            //my range is 0-6. I normalize ranges, get the "one" mapping and turn result into original scale
            return mapTo(dayOfWeek, new WeekDay(targetWeekDayDefinition.getMondayDoWValue() - 1, true)) + 1;
        }
    }
450932
public final void setWeekDay(WeekDay weekDay) {

        SortedSet<WeekDay> wds = new TreeSet<>();
        if (null != weekDay) {
            wds.add(weekDay);
        }
        setWeekDays(wds);

    }
220877
def get_day_name(self) -> str:
        
        weekday = self.value.isoweekday() - 1
        return calendar.day_name[weekday]
682538
public WeeklyAutoScalingSchedule withFriday(java.util.Map<String, String> friday) {
        setFriday(friday);
        return this;
    }
1319732
public static DayOfWeek dayOfWeek(DateValue date) {
		int dayIndex = fixedFromGregorian(date.year(), date.month(), date.day()) % 7;
		if (dayIndex < 0) {
			dayIndex += 7;
		}
		return DAYS_OF_WEEK[dayIndex];
	}
599921
private void readNormalDay(ProjectCalendar calendar, Project.Calendars.Calendar.WeekDays.WeekDay weekDay)
   {
      int dayNumber = weekDay.getDayType().intValue();
      Day day = Day.getInstance(dayNumber);
      calendar.setWorkingDay(day, BooleanHelper.getBoolean(weekDay.isDayWorking()));
      ProjectCalendarHours hours = calendar.addCalendarHours(day);

      Project.Calendars.Calendar.WeekDays.WeekDay.WorkingTimes times = weekDay.getWorkingTimes();
      if (times != null)
      {
         for (Project.Calendars.Calendar.WeekDays.WeekDay.WorkingTimes.WorkingTime period : times.getWorkingTime())
         {
            Date startTime = period.getFromTime();
            Date endTime = period.getToTime();

            if (startTime != null && endTime != null)
            {
               if (startTime.getTime() >= endTime.getTime())
               {
                  endTime = DateHelper.addDays(endTime, 1);
               }

               hours.addRange(new DateRange(startTime, endTime));
            }
         }
      }
   }
1209365
@Nonnegative
  public static DayOfWeek getWeekday (@Nonnull final Weekday eWeekday)
  {
    switch (eWeekday)
    {
      case MONDAY:
        return DayOfWeek.MONDAY;
      case TUESDAY:
        return DayOfWeek.TUESDAY;
      case WEDNESDAY:
        return DayOfWeek.WEDNESDAY;
      case THURSDAY:
        return DayOfWeek.THURSDAY;
      case FRIDAY:
        return DayOfWeek.FRIDAY;
      case SATURDAY:
        return DayOfWeek.SATURDAY;
      case SUNDAY:
        return DayOfWeek.SUNDAY;
      default:
        throw new IllegalArgumentException ("Unknown weekday " + eWeekday);
    }
  }
975553
public String getWeekdayRelativeTo(String date, int weekday, int number, boolean count_itself) {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
		Calendar c = Calendar.getInstance();
				
		int day;
		int add;
		
		if(number == 0) {
			try{
				c.setTime(formatter.parse(date));
				date = formatter.format(c.getTime());
			} catch (ParseException e) {
				e.printStackTrace();
			}
			return date;			
		}
		else{
			
			if(number<0) {
				number+=1;
			}
						
			try{
				c.setTime(formatter.parse(date));
				day = c.get(Calendar.DAY_OF_WEEK);
				if((count_itself && number>0) || (!count_itself && number <= 0)) {
					if(day<=weekday) {
						add = weekday - day;
					}
					else{
						add = weekday - day + 7;
					}	
				}
				else{
					if(day<weekday) {
						add = weekday - day;
					}
					else{
						add = weekday - day + 7;
					}	
				}
				add += (( number - 1) * 7);
				c.add(Calendar.DAY_OF_MONTH, add);
				date = formatter.format(c.getTime());
			} catch (ParseException e) {
				e.printStackTrace();
			}
			return date;
		}
	}
1169114
public static int getDayOfWeek(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.DAY_OF_WEEK);
    }
1132012
public Project.Calendars.Calendar.WeekDays.WeekDay createProjectCalendarsCalendarWeekDaysWeekDay()
   {
      return new Project.Calendars.Calendar.WeekDays.WeekDay();
   }
399753
public void setWeekDayFormatter(WeekDayFormatter formatter) {
    adapter.setWeekDayFormatter(formatter == null ? WeekDayFormatter.DEFAULT : formatter);
  }
1077859
void formatWeekday(StringBuilder b, ZonedDateTime d, int width, FieldVariants weekdays) {
    int weekday = d.getDayOfWeek().getValue() % 7;
    switch (width) {
      case 6:
        b.append(weekdays.short_[weekday]);
        break;

      case 5:
        b.append(weekdays.narrow[weekday]);
        break;

      case 4:
        b.append(weekdays.wide[weekday]);
        break;

      case 3:
      case 2:
      case 1:
        b.append(weekdays.abbreviated[weekday]);
        break;
    }
  }
1110030
private BigInteger getDaysOfTheWeek(RecurringData data)
   {
      int value = 0;
      for (Day day : Day.values())
      {
         if (data.getWeeklyDay(day))
         {
            value = value | DAY_MASKS[day.getValue()];
         }
      }
      return BigInteger.valueOf(value);
   }
399272
public WeeklyAutoScalingSchedule withThursday(java.util.Map<String, String> thursday) {
        setThursday(thursday);
        return this;
    }
67893
def weekdays(self):
        
        if self.itemStyle() == self.ItemStyle.Group:
            out = 0
            for i in range(self.childCount()):
                out += self.child(i).weekdays()
            return out
        else:
            dstart = self.dateStart().toPyDate()
            dend   = self.dateEnd().toPyDate()
            
            return projex.dates.weekdays(dstart, dend)
624890
private WeekDay readWeekDay(JSONValue val) throws IllegalArgumentException {

        String str = readOptionalString(val);
        if (null != str) {
            return WeekDay.valueOf(str);
        }
        throw new IllegalArgumentException();
    }
1161405
public com.google.type.DayOfWeek getDayOfWeekValue() {
    if (typeCase_ == 8) {
      @SuppressWarnings("deprecation")
      com.google.type.DayOfWeek result =
          com.google.type.DayOfWeek.valueOf((java.lang.Integer) type_);
      return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result;
    }
    return com.google.type.DayOfWeek.DAY_OF_WEEK_UNSPECIFIED;
  }