예제 #1
0
        private DateTime getRangeStart(DateTime date)
        {
            int weekNum = WeekNumber.GetWeekNumber(date);

            if (weekNum % 2 == 0)
            {
                --weekNum;
            }

            return(WeekNumber.GetDateFromWeek(date.Year, weekNum));
        }
예제 #2
0
        private void b_ViewTime_Click(object sender, EventArgs e)
        {
            Number_Getter numGet = new Number_Getter(0, 53, WeekNumber.GetWeekNumber(DateTime.Now));

            numGet.ShowDialog();

            int      weekNum = numGet.Number;
            DateTime date    = WeekNumber.GetDateFromWeek(currentYear, weekNum);

            outputToTimesheet(date);
        }
예제 #3
0
        private void applyWeekNum()
        {
            DateTime date = period.Date;
            int weekNum = WeekNumber.GetWeekNumber(date);
            l_dayOfMonth.Text = date.Day.ToString();

            if (date.Day == 1 || date.DayOfWeek == 0 || (string)this.Tag == "debug")
            {
                l_weekNum.Text = weekNum.ToString();
            }
            else
            {
                l_weekNum.Text = "";
            }
        }
예제 #4
0
        private void FillDateAndWeek()
        {
            if (codes == null || codes.Count == 0)
            {
                return;
            }

            DateTime start = this.startDate;
            //DateTime end = this.startDate.AddDays(14.0);

            int startWeek = WeekNumber.GetWeekNumber(start);
            int endWeek   = startWeek + 1;

            weekNo.Text = startWeek.ToString() + " & " + endWeek.ToString();

            string dateFormat = "yyyy-MM-dd";

            date.Text = start.ToString(dateFormat) + " - " + start.AddDays(13.0).ToString(dateFormat);
        }