Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Helping Changing Date Order

I have in my styles.css the following 

#myDate {
font-size: 35;
font-family: Colfax-Medium;
text-length: 20;
text-anchor: middle;
x: 50%;
y: 0%+131;
fill: #f8fcf8;
}

 

but not sure if that has to do with how my date is displayed, right now it shows
"Day, Date/Month/Year" (Mo, 09/04/2018)

I would just like the month and date to swap.... (Day, Month/Date/Year) but I looked in all the scripts and couldnt find where to find that unless I have to code that in somewhere...help!

Best Answer
0 Votes
4 REPLIES 4

Rearrange them in the code you set the date string.

Best Answer
0 Votes

i used a template and did some tweaks like changing the background only but I can’t find anywhere that shows the format for the date...only some codes that refer to it.

Best Answer
0 Votes

Can you paste the code here please?

Best Answer
0 Votes

This is some of my code and it's based on one of the samples, so hopefully similar!

 

function updateClock() {
  let today = new Date();
  let hours = today.getHours();
  let mins = util.zeroPad(today.getMinutes());
  let day = today.getDate();
  const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  let month = months[today.getMonth()];

  timeText.text = `${hours}:${mins}`;
  dateText.text = `${day} ${month}`;
}

This sets the text string called "dateText" in my SVG file to be the day followed by the month. Changing this around will swap them. eg.

function updateClock() {
  let today = new Date();
  let hours = today.getHours();
  let mins = util.zeroPad(today.getMinutes());
  let day = today.getDate();
  const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  let month = months[today.getMonth()];

  timeText.text = `${hours}:${mins}`;
  dateText.text = `${month} ${day}`;
}

 

Best Answer
0 Votes