Ejemplo n.º 1
0
        public static JsDate addDays(this JsDate date, JsNumber days)
        {
            var date2 = new JsDate(date.valueOf());

            date2.setDate(date2.getDate() + days);
            return(date2);
        }
Ejemplo n.º 2
0
        public TimeSpan Subtract(DateTime value)
        {
            var utc1 = JsDate.UTC(
                date.getFullYear(),
                date.getMonth(),
                date.getDate(),
                date.getHours(),
                date.getMinutes(),
                date.getSeconds(),
                date.getMilliseconds()).As <long>();
            var utc2 = JsDate.UTC(
                value.As <JsImplDateTime>().date.getFullYear(),
                value.As <JsImplDateTime>().date.getMonth(),
                value.As <JsImplDateTime>().date.getDate(),
                value.As <JsImplDateTime>().date.getHours(),
                value.As <JsImplDateTime>().date.getMinutes(),
                value.As <JsImplDateTime>().date.getSeconds(),
                value.As <JsImplDateTime>().date.getMilliseconds()).As <long>();

            var diff = utc1 - utc2;

            return(new TimeSpan(diff * TimeSpan.TicksPerMillisecond));
        }
Ejemplo n.º 3
0
        public static JsDate removeTime(this JsDate date)
        {
            var date2 = new JsDate(date.getFullYear(), date.getMonth(), date.getDate());

            return(date2);
        }
Ejemplo n.º 4
0
 public static JsDate addDays(this JsDate date, JsNumber days)
 {
     var date2 = new JsDate(date.valueOf());
     date2.setDate(date2.getDate() + days);
     return date2;
 }
Ejemplo n.º 5
0
 void foo5(object obj)
 {
     //dynamic result = obj;
     //JsArray data = new JsArray();
     JsArray reminders = new JsArray();// DataUtils.toArray(result.PatientReminder);
     JsObject reminder;
     JsDate now = new JsDate();
     JsDate startOfToday = new JsDate(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
     JsDate dueDate;
     foreach (dynamic item in reminders)
     {
         dueDate = new JsDate(item.DueDate["$t"]);
         reminder = new JsObject();
         reminder["Due"] = item.DueDate["$t"];
         reminder["Done"] = item.PrevDate["$t"];
         reminder["Subject"] = item.Description["$t"];
         reminder["PastDue"] = dueDate.getTime() < startOfToday.getTime() ? "red" : "";
         data.push(reminder);
     }
     //bool success = true;
     //if (success != null)
     //{
     //    success(data);
     //}
 }