Beispiel #1
0
        // System.DateTime
        public JsImplDateTime Subtract(TimeSpan value)
        {
            var newDate = new JsDate(date.valueOf());

            newDate.setMilliseconds(date.getMilliseconds() + value.TotalMilliseconds);
            return(new JsImplDateTime(newDate));
        }
Beispiel #2
0
        public static JsDate addMilliseconds(this JsDate date, int miliseconds)
        {
            var date2 = new JsDate(date.valueOf());

            date2.setMilliseconds(date2.getMilliseconds() + miliseconds);
            return(date2);
        }
Beispiel #3
0
        /// <summary>
        /// Returns a new <see cref="T:System.DateTime"/> that adds the specified number of ticks to the value of this instance.
        /// </summary>
        ///
        /// <returns>
        /// An object whose value is the sum of the date and time represented by this instance and the time represented by <paramref name="value"/>.
        /// </returns>
        /// <param name="value">A number of 100-nanosecond ticks. The <paramref name="value"/> parameter can be positive or negative. </param><exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime"/> is less than <see cref="F:System.DateTime.MinValue"/> or greater than <see cref="F:System.DateTime.MaxValue"/>. </exception><filterpriority>2</filterpriority>
        public DateTime AddTicks(long value)
        {
            var milliseconds = value / TimeSpan.TicksPerMillisecond;
            var newDate      = new JsDate(this.value.getTime());

            newDate.setMilliseconds(newDate.getMilliseconds() + (int)(milliseconds));
            return(new DateTime(newDate));
        }
Beispiel #4
0
 // System.DateTime
 public JsImplDateTime Subtract(TimeSpan value)
 {
     var newDate = new JsDate(date.valueOf());
     newDate.setMilliseconds(date.getMilliseconds() + value.TotalMilliseconds);
     return new JsImplDateTime(newDate);
 }