コード例 #1
0
        public void PlusWeeks_Simple()
        {
            LocalDateTime start            = new LocalDateTime(2011, 4, 2, 12, 15, 8);
            LocalDateTime expectedForward  = new LocalDateTime(2011, 4, 23, 12, 15, 8);
            LocalDateTime expectedBackward = new LocalDateTime(2011, 3, 12, 12, 15, 8);

            Assert.AreEqual(expectedForward, start.PlusWeeks(3));
            Assert.AreEqual(expectedBackward, start.PlusWeeks(-3));
        }
コード例 #2
0
 public void PlusWeeks()
 {
     SampleStartDateTime.PlusWeeks(3);
 }
コード例 #3
0
 public LocalDateTime PlusWeeks() => Sample.PlusWeeks(3);
コード例 #4
0
 public void PlusWeeks()
 {
     Sample.PlusWeeks(3).Consume();
 }
コード例 #5
0
 public void PlusWeeks_Simple()
 {
     LocalDateTime start = new LocalDateTime(2011, 4, 2, 12, 15, 8);
     LocalDateTime expectedForward = new LocalDateTime(2011, 4, 23, 12, 15, 8);
     LocalDateTime expectedBackward = new LocalDateTime(2011, 3, 12, 12, 15, 8);
     Assert.AreEqual(expectedForward, start.PlusWeeks(3));
     Assert.AreEqual(expectedBackward, start.PlusWeeks(-3));
 }
コード例 #6
0
 public LocalDateTime PlusWeeks()
 {
     return(Sample.PlusWeeks(3));
 }
コード例 #7
0
 public IDateTime PlusWeeks(int weeks)
 {
     return(new DateTime(_localDateTime.PlusWeeks(weeks)));
 }
コード例 #8
0
 /// <summary>
 /// Add weeks
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="weeks"></param>
 /// <returns></returns>
 public static LocalDateTime AddWeeks(this LocalDateTime ld, int weeks) => ld.PlusWeeks(weeks);