示例#1
0
        public void SetMillisecondsWorks()
        {
            var dt = new JsDate(2000, 0, 1);

            dt.SetMilliseconds(435);
            Assert.AreEqual(dt.GetMilliseconds(), 435);
        }
示例#2
0
        public static JsDate RoundToMinutes(JsDate date, int minutesStep)
        {
            date = new JsDate(date.GetTime());

            var m = (int)(Math.Round((double)date.GetMinutes() / minutesStep) * minutesStep);

            date.SetMinutes(m);
            date.SetSeconds(0);
            date.SetMilliseconds(0);
            return(date);
        }