public void SetMinutesWorks() { var dt = new JsDate(2000, 0, 1); dt.SetMinutes(34); Assert.AreEqual(dt.GetMinutes(), 34); }
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); }