New() public method

public New ( ) : JsNumber
return JsNumber
コード例 #1
0
        public JsInstance GetSecondsImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (double.IsNaN(target.ToNumber()))
            {
                return(this.Global.NaN);
            }
            JsNumberConstructor numberClass = this.Global.NumberClass;
            DateTime            dateTime    = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime = dateTime.ToLocalTime();
            double second = (double)dateTime.Second;

            return((JsInstance)numberClass.New(second));
        }
コード例 #2
0
        public JsInstance GetUTCHoursImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (double.IsNaN(target.ToNumber()))
            {
                return(this.Global.NaN);
            }
            JsNumberConstructor numberClass = this.Global.NumberClass;
            DateTime            dateTime    = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime = dateTime.ToUniversalTime();
            double hour = (double)dateTime.Hour;

            return((JsInstance)numberClass.New(hour));
        }