Exemplo n.º 1
0
        public static JsDate addMonths(this JsDate date, JsNumber months)
        {
            var date2 = new JsDate(date.valueOf());

            date2.setMonth(date2.getMonth() + months);
            return(date2);
        }
Exemplo n.º 2
0
        public static JsDate addYears(this JsDate date, JsNumber years)
        {
            var date2 = new JsDate(date.valueOf());

            date2.setMonth(date2.getFullYear() + years);
            return(date2);
        }
Exemplo n.º 3
0
        public static JsDate addDays(this JsDate date, JsNumber days)
        {
            var date2 = new JsDate(date.valueOf());

            date2.setDate(date2.getDate() + days);
            return(date2);
        }
Exemplo n.º 4
0
        public static JsDate addHours(this JsDate date, int hours)
        {
            var date2 = new JsDate(date.valueOf());

            date2.setHours(date2.getHours() + hours);
            return(date2);
        }
Exemplo n.º 5
0
        public static JsDate addMinutes(this JsDate date, int minutes)
        {
            var date2 = new JsDate(date.valueOf());

            date2.setMinutes(date2.getMinutes() + minutes);
            return(date2);
        }
Exemplo n.º 6
0
        public static JsDate addSeconds(this JsDate date, int seconds)
        {
            var date2 = new JsDate(date.valueOf());

            date2.setSeconds(date2.getSeconds() + seconds);
            return(date2);
        }
Exemplo n.º 7
0
        // System.DateTime
        public JsImplDateTime Subtract(TimeSpan value)
        {
            var newDate = new JsDate(date.valueOf());

            newDate.setMilliseconds(date.getMilliseconds() + value.TotalMilliseconds);
            return(new JsImplDateTime(newDate));
        }
Exemplo n.º 8
0
 static int CompareJsDates(JsDate d1, JsDate d2)
 {
     if (d1 == d2)
         return 0;
     if (d1 == null)
         return 1;
     if (d2 == null)
         return -1;
     return d1.valueOf() - d2.valueOf();
 }