Data missing from iPhone app

Hey - I’m playing with TV streaming app and have a little problem with the iPhone client - it’s not coming back with one particular value and I can’t figure out what I’m doing wrong. The screen should look like this (taken from Glide layout mode on my pc):

It shows the day that the series airs next to the service.

on the iPhone it looks like this:

The text was originally a template and the weekday was just blank so I created a string in javascript instead to see what, if anything, was there (p1 is the weekday column below, p2 is the watching on text you can see):

return p1 + "s on " + p2;

The weekday text that shows as “undefined” is a js snippet that looks up a numeric weekday value and returns a corresponding string (p1 is a column containing the date):

const dt = new Date(p1);
const dy = dt.getDay();
const dn = [“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”];

return dn[dy];

The resulting data looks like this:

image

Any thoughts on why this not returning a value on the app even though I can see the data on the table?

It is most likely that Safari doesn’t like this part:

const dt = new Date(p1);
const dy = dt.getDay();

Since the way Safari reads dates can be different from other browsers, I learned it the hard way.

I would set it up with a math column to return the weekday, then get the weekday name based on the weekday number instead. Finally, use a template column (you don’t need JS for that) to construct this part.

return p1 + "s on " + p2;
1 Like

Perfect!
I just did the math fix and it worked. I figured it was Safari but didn’t know how to get to the problem. I should have known better than to rely on the browser to do it.

Thanks so much :smile:

By the way - the string construct was a template - I just put it in a js string to see what it returned (not v helpful at the end of the day).

1 Like