private DateTime?GetDate(Awesomium_Core.JSValue iJSValue)
        {
            if (!iJSValue.IsObject)
            {
                return(null);
            }

            Awesomium_Core.JSObject ob = iJSValue;

            Awesomium_Core.JSObject extractor = GetExtractor();
            if ((bool)extractor.Invoke("isDate", iJSValue) == false)
            {
                return(null);
            }

            int year        = (int)ob.Invoke("getFullYear", null);
            int month       = (int)ob.Invoke("getMonth", null) + 1;
            int day         = (int)ob.Invoke("getDate", null);
            int hour        = (int)ob.Invoke("getHours", null);
            int minute      = (int)ob.Invoke("getMinutes", null);
            int second      = (int)ob.Invoke("getSeconds", null);
            int millisecond = (int)ob.Invoke("getMilliseconds", null);

            return(new DateTime(year, month, day, hour, minute, second, millisecond));
        }
示例#2
0
        private DateTime?GetDate(Awesomium_Core.JSValue iJSValue)
        {
            if (!iJSValue.IsObject)
            {
                return(null);
            }

            Awesomium_Core.JSObject ob = iJSValue;

            if (ob == null)
            {
                return(null);
            }

            Awesomium_Core.JSObject ko = _IWebView.ExecuteJavascriptWithResult("ko");
            if ((bool)ko.Invoke("isDate", iJSValue) == false)
            {
                return(null);
            }

            int year        = (int)ob.Invoke("getFullYear", null);
            int month       = (int)ob.Invoke("getMonth", null) + 1;
            int day         = (int)ob.Invoke("getDate", null);
            int hour        = (int)ob.Invoke("getHours", null);
            int minute      = (int)ob.Invoke("getMinutes", null);
            int second      = (int)ob.Invoke("getSeconds", null);
            int millisecond = (int)ob.Invoke("getMilliseconds", null);

            return(new DateTime(year, month, day, hour, minute, second, millisecond));
        }