01-15-2019 19:28
01-15-2019 19:28
Hi, I am trying to put the day of week onto my Versa watch face, but I can't seem to find a tutorial on how to do it or even how to really code in JavaScript. I've gone through the first "getting started" tutorial and looked through the rest of the things in the glossary, guides, and online on other websites. A little push in the right direction or some help on the code would be greatly appreciated.
Answered! Go to the Best Answer.
01-30-2019 15:06 - edited 01-30-2019 15:24
01-30-2019 15:06 - edited 01-30-2019 15:24
Update: I figured out the error and fixed it, but it still won't show up. What else is there to do for this? I think the problem isn't wrong in terms of an error but just isn't being completed and showing up.
Update: Never mind comic sans wasn't a font I could use and that screwed everything up
01-16-2019 09:24
01-16-2019 09:24
You can have an array of day names and the javascript getDay() method:
const dayLabel = document.getElementById("dayLabel");
let today = new Date(); // or get this from the tick event (evt.date)
const days = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
let dayName = days[today.getDay()];
dayLabel.text = dayName;
01-16-2019 16:08
01-16-2019 16:08
Ok, so i put those into the index.js file and its still not working. I put some code (or at least what i thought was the right code) into the index.gui and the styles.css file too because I thought that would be what I would do. It keeps giving me a error message "Error 22 Unclosed element 'image'" which when i go to it brings me to the index.gui file(resources/index.gui:8,1).
<svg> <image href="op1.jpg"> <text id="myLabel"></text> <text id="myMonth" /> <text id="myDay" /> <text id="dayofWeek"/> </svg>
op1.jpg is my background. Why would that be giving me a error out of all of the code? I'll attach my other code so you can see if there is a error in it or not.
01-30-2019 15:06 - edited 01-30-2019 15:24
01-30-2019 15:06 - edited 01-30-2019 15:24
Update: I figured out the error and fixed it, but it still won't show up. What else is there to do for this? I think the problem isn't wrong in terms of an error but just isn't being completed and showing up.
Update: Never mind comic sans wasn't a font I could use and that screwed everything up