// Start is called before the first frame update. void Start() { // Image references. back1 = GameObject.Find("Back1").GetComponent <Image>(); back2 = GameObject.Find("Back2").GetComponent <Image>(); back3 = GameObject.Find("Back3").GetComponent <Image>(); girl01 = GameObject.Find("Girl01").GetComponent <Image>(); girl02 = GameObject.Find("Girl02").GetComponent <Image>(); girl03 = GameObject.Find("Girl03").GetComponent <Image>(); girl11 = GameObject.Find("Girl11").GetComponent <Image>(); girl12 = GameObject.Find("Girl12").GetComponent <Image>(); girl13 = GameObject.Find("Girl13").GetComponent <Image>(); girl21 = GameObject.Find("Girl21").GetComponent <Image>(); girl22 = GameObject.Find("Girl22").GetComponent <Image>(); girl23 = GameObject.Find("Girl23").GetComponent <Image>(); girl31 = GameObject.Find("Girl31").GetComponent <Image>(); girl32 = GameObject.Find("Girl32").GetComponent <Image>(); girl33 = GameObject.Find("Girl33").GetComponent <Image>(); girl41 = GameObject.Find("Girl41").GetComponent <Image>(); girl42 = GameObject.Find("Girl42").GetComponent <Image>(); girl43 = GameObject.Find("Girl43").GetComponent <Image>(); StartImages(); firstDay = GameObject.Find("TextBoxText").GetComponent <FirstDay>(); }
private void GetWeekFirstLastDay() { var firstOfThisYear = new DateTime(year, 1, 1); var dayOfWeekOfThisYear = culture.Calendar.GetDayOfWeek(firstOfThisYear); var isThur = dayOfWeekOfThisYear == DayOfWeek.Thursday; var isLeapAndWed = DateTime.DaysInMonth(year, 2) == 29 && dayOfWeekOfThisYear == DayOfWeek.Wednesday; if (isThur || isLeapAndWed) { weeksOfYear = 53; } else { weeksOfYear = 52; } if (isLastYearLeapAndWed()) { firstDay = firstOfThisYear.AddDays(week * 7 - (int)dayOfWeekOfThisYear + 1); } else { firstDay = firstOfThisYear.AddDays((week - 1) * 7 - (int)dayOfWeekOfThisYear + 1); } CheckWeekOutRange(); lastDay = FirstDay.AddDays(7); }
public ScheduleDay GetScheduleDay(int dayNumber) { var day = FirstDay.AddDays(dayNumber - 1); if (day.Month != FirstDay.Month) { return(null); } return(new ScheduleDay(day, IsHoliday(day), IsPreHoliday(day), IsRestday(day), IsMove(day), GetTooltip(day))); }
public CalendarWeekViewModel(DateTime date) { _date = date; // Vytvoření Commandů pro navigaci kalendářem po týdnech Command_CurrentWeek = new ChangeViewModelCommand <CalendarWeekViewModel>(DateTime.Now); Command_PreviousWeek = new ChangeViewModelCommand <CalendarWeekViewModel>(_date.AddDays(-7)); Command_NextWeek = new ChangeViewModelCommand <CalendarWeekViewModel>(_date.AddDays(7)); DayCells = new(); for (int i = 0; i < 7; i++) { DayCells.Add(new DayCellViewModel(FirstDay.AddDays(i))); } }
public WeekOvertime(int year, int week, double worktime, double requiredtime) { var dfi = DateTimeFormatInfo.CurrentInfo; var cal = dfi.Calendar; var fd = dfi.FirstDayOfWeek; var firstinyear = new DateTime(year, 1, 1); var firstDayOfWeek = firstinyear.AddDays(dfi.FirstDayOfWeek - firstinyear.DayOfWeek); Year = year; Week = week; FirstDay = firstDayOfWeek.AddDays(7 * (week - 1)); LastDay = FirstDay.AddDays(6.0); WorkTimePerWeek = worktime; RequiredWorkTimePerWeek = requiredtime; }
public void Init() { day = Memory.Instance.GetDay(); engueule = Memory.Instance.GetEngueule(); if (day == 1) { firstDay = gameObject.GetComponent<FirstDay>(); firstDay.PlayDay(); } else if (day == 2) { statistics = Memory.Instance.GetStatistics(); statNames = Memory.Instance.GetStatNames(); secondDay = gameObject.GetComponent<SecondDay>(); } else { statistics = Memory.Instance.GetStatistics(); statNames = Memory.Instance.GetStatNames(); thirdDay = gameObject.GetComponent<ThirdDay>(); } }
public Calendar( DateTime startDate, int length, ICollection <DateTime> holidays, ICollection <DayOfWeek> weekDays) { if (length < 1) { throw new ArgumentOutOfRangeException(nameof(length), "The minimum length is one day."); } for (var x = 0; x < length; x++) { var addingDate = new CalendarDate { RepresentedDate = startDate.Date.AddDays(x), }; addingDate.IsHoliday = holidays.Contains(addingDate.RepresentedDate); addingDate.IsWeekday = weekDays.Contains(addingDate.RepresentedDate.DayOfWeek); _dates.Add(addingDate); } FirstDay = startDate.Date; LastDay = FirstDay.AddDays(length - 1); }
private void SetupScript() { if (ShowTime) { SetupTimePickerScript(); } StringBuilder script = new StringBuilder(); script.Append("<script type=\"text/javascript\"> "); script.Append("\n"); script.Append("$(document).ready(function() { "); if (ShowTimeOnly) { script.Append("$('#" + ClientID + "').timepicker("); } else if (ShowTime) { script.Append("$('#" + ClientID + "').datetimepicker("); } else { script.Append("$('#" + ClientID + "').datepicker("); } script.Append("{"); script.Append("showOn: '" + ShowOn + "'"); if (ButtonImage.Length > 0) { //script.Append(",buttonImage: '" + Page.ResolveUrl("/Data/SiteImages/calendar.png") + "' "); script.Append(",buttonImage: '" + Page.ResolveUrl(ButtonImage) + "' "); } if (ButtonImageOnly) { script.Append(",buttonImageOnly: true"); } script.Append(",buttonText:'...'"); script.Append(",duration: ''"); if (ShowTime) { // in .NET M means month 1 -12 with no leading zero // in javascript it means month name like Dec // we need m for month with no leading zero, so we need to lower it // also in C# yyyy means four digit year but in js yy means 4 digit year so // we must replace yyyy with yy string dateFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern.Replace("M", "m").Replace("yyyy", "yy"); //http://trentrichardson.com/examples/timepicker/ //in .NET tt means use AM or PM but in this js it means am or pm // wee need TT to get AM or PM string timeFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Replace("tt", "TT"); script.Append(",dateFormat:'" + dateFormat + "'"); script.Append(",timeFormat:'" + timeFormat + "'"); if (ClockHours != "24") { // script.Append(",'ampm': true "); // localize the labels script.Append(",timeOnlyTitle:'" + Resource.TimePickerTimeOnlyTitle + "'"); script.Append(",timeText:'" + Resource.TimePickerTimeText + "'"); script.Append(",hourText:'" + Resource.TimePickerHourText + "'"); script.Append(",minuteText:'" + Resource.TimePickerMinuteText + "'"); script.Append(",secondText:'" + Resource.TimePickerSecondText + "'"); script.Append(",currentText:'" + Resource.TimePickerCurrentText + "'"); script.Append(",closeText:'" + Resource.TimePickerCloseText + "'"); } } if (ChangeMonth) { script.Append(",changeMonth:true"); } if (ChangeYear) { script.Append(",changeYear:true,yearRange:'" + YearRange + "'"); } if (ShowWeek) { script.Append(",showWeek:true"); } if (FirstDay > -1) { script.Append(",firstDay:" + FirstDay.ToInvariantString()); } if (CalculateWeek.Length > 0) { script.Append(",calculateWeek:" + CalculateWeek); } script.Append("}"); script.Append("); "); script.Append(" });"); script.Append("\n "); script.Append(" </script>"); ScriptManager.RegisterStartupScript( this, this.GetType(), "setup" + this.ClientID, script.ToString(), false); if (ShowTime) { switch (CultureInfo.CurrentCulture.TwoLetterISOLanguageName) { case "en": //do nothing en is the edefault break; default: string timeCulture = GetTimePickerSupportedLangCode(CultureInfo.CurrentCulture.Name, CultureInfo.CurrentCulture.TwoLetterISOLanguageName); string localizationFile = WebConfigSettings.TimePickerScriptLocaleBaseUrl + "jquery-ui-timepicker-" + timeCulture + ".js"; if (File.Exists(HostingEnvironment.MapPath(localizationFile))) { ScriptManager.RegisterStartupScript(this, typeof(Page), "jqtimelocal", "\n<script src=\"" + Page.ResolveUrl(localizationFile) + "\" type=\"text/javascript\"></script>", false); } break; } } }
public void NextPeriod() { SetPeriod(FirstDay.AddMonths(1).Year, FirstDay.AddMonths(1).Month); ReloadSeries(); }