Timer shows military time only on cell phone

Let’s start at the top and work down.

Okay, that would be the const keywords. Rename those to var instead.

Todo list:

  • :white_check_mark: Fetch
  • Const
  • Arrow notation
  • Destructuring
  • Promises

Not sure what these are:

image

We’ll get to those later. I’m just keeping track of what we’ve dealt with, and future things that need to be done later.

This is done…
image

Good one.

Next up is the destructuring.

Here is the involved code.

        var [year, month, day, hour, min, sec] = res.split(',');

With Internet Explorer that needs to be done in a longer form by first splitting to a local array, then assigning each part of that to separate variables.

        var split = res.split(",");
        var year = split[0];
        var month = split[1];
        var day = split[2];
        var hour = split[3];
        var min = split[4];
        var sec = split[5];

Done!

Good one - the last thing is promises, for which the following promise polyfill is used with Internet Explorer.

Now you lost me! Opened link but don’t understand.

There is a download section there.

Which one…
image

Or do you want me to use CDN Polyfill script instead?

Either one works. The minified one is preferable as it means less data transfer when people load your page.

Do I just wrap that in the script tag? And do you want it top or bottom of page? And once I do that and I already have the fetch js in folder, do I give it a try?

Yes use a script tag, and all scripts should be at the bottom of the body.

Ok, anything else, because it’s not working in any browser at this stage?

At every stage it does remain working in all other browsers. I recommend that you start over from the start, and test it after every step to figure out where your trouble begins.

To be sure that I got this right, does this:
image
refer to using var to replace image

No it doesn’t. I’m not on a computer right now, but arrow notation means replacing the => functions with fully qualified function notation instead, including function keyword, optional (and preferred) function name, function braces, and where needed return keyword.

Well that is well I probably messed up. I need to know what you mean image to be replace by var.

It seems that you are confusing some things. It is the const keywords that need to be replaced with var.