예제 #1
0
 public override void calculateFeedDate()
 {
     if (isActivePeriod())
     {
         FeedDate = DateFormatter.addDays(FeedDate, 2);
     }
     else
     {
         FeedDate = DateFormatter.addDays(FeedDate, 1);
     }
 }
예제 #2
0
        public override void calculateFeedDate()
        {
            var month = DateTime.Now.Month;

            if (FeedDate.Equals(DateFormatter.getCurrentDate()))
            {
                Hungry = true;
                return;
            }
            if (isWinter(month))
            {
                int year = DateTime.Now.Year;
                if (month == 12)
                {
                    year++;
                }

                FeedDate = year + "-03-01";
                return;
            }

            if (Hungry)
            {
                FeedDate = DateFormatter.getCurrentDate();
                return;
            }

            if (!isWinter(month) && !Hungry)
            {
                if (!isActivePeriod(month))
                {
                    FeedDate = DateFormatter.addDays(FeedDate, 2);
                }
                else
                {
                    FeedDate = DateFormatter.addDays(FeedDate, 1);
                }
            }
        }