Asked  7 Months ago    Answers:  5   Viewed   35 times

According to this post it was in the beta, but it's not in the release?

 Answers

80

Even better for fallback is this:


   var alertFallback = true;
   if (typeof console === "undefined" || typeof console.log === "undefined") {
     console = {};
     if (alertFallback) {
         console.log = function(msg) {
              alert(msg);
         };
     } else {
         console.log = function() {};
     }
   }

Tuesday, June 1, 2021
 
PHPWDev
answered 7 Months ago
52

In older browsers, you can write a function that will parse the string for you.

This one creates a Date.fromISO method- if the browser can natively get the correct date from an ISO string, the native method is used.

Some browsers got it partly right, but returned the wrong timezone, so just checking for NaN may not do.

Polyfill:

(function(){
    var D= new Date('2011-06-02T09:34:29+02:00');
    if(!D || +D!== 1307000069000){
        Date.fromISO= function(s){
            var day, tz,
            rx=/^(d{4}-dd-dd([tT ][d:.]*)?)([zZ]|([+-])(dd):(dd))?$/,
            p= rx.exec(s) || [];
            if(p[1]){
                day= p[1].split(/D/);
                for(var i= 0, L= day.length; i<L; i++){
                    day[i]= parseInt(day[i], 10) || 0;
                };
                day[1]-= 1;
                day= new Date(Date.UTC.apply(Date, day));
                if(!day.getDate()) return NaN;
                if(p[5]){
                    tz= (parseInt(p[5], 10)*60);
                    if(p[6]) tz+= parseInt(p[6], 10);
                    if(p[4]== '+') tz*= -1;
                    if(tz) day.setUTCMinutes(day.getUTCMinutes()+ tz);
                }
                return day;
            }
            return NaN;
        }
    }
    else{
        Date.fromISO= function(s){
            return new Date(s);
        }
    }
})()

Result:

var start_time = '2012-06-24T17:00:00-07:00';
var d =  Date.fromISO(start_time);
var month = d.getMonth();
var day = d.getDate();

alert(++month+' '+day); // returns months from 1-12
Wednesday, June 9, 2021
 
conmen
answered 6 Months ago
95

It's waiting to be implemented. See issues #629 & #4526.

Update: according to comments below (unverified) - this feature is finally slated for release in .NET Core 2.1!

Tuesday, August 3, 2021
 
andrews_nz
answered 4 Months ago
89

I also use virtualisation. I've got Virtual PC 2007, which is a free download from here, on my machine and have downloaded the Internet Explorer Virual PC images from Microsoft. You can get the images here.

Friday, September 3, 2021
 
Malloc
answered 3 Months ago
79

This is officially a bug and will be fixed for next platform release: https://code.google.com/p/android/issues/detail?id=58280

UPDATE: This seems to be fixed on API level 19

Saturday, September 4, 2021
 
user809829
answered 3 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :  
Share