Author Topic: Saratoga template date settings [Resolved]  (Read 1063 times)

0 Members and 1 Guest are viewing this topic.

Offline Vasco

  • Forecaster
  • *****
  • Posts: 342
    • PWS
Saratoga template date settings [Resolved]
« on: November 11, 2022, 03:02:50 PM »
New user of template, not quite ready to go public, having a few problems navigating the site. (TBH, I wouldn't have a site if Ken hadn't already sorted some quirks of my ISP  :-) )

Having set

Code: [Select]
$SITE['timeFormat'] = 'j/n/y H:i';
in Settings.php, why do I get Y in the headlines? I would prefer y, so how can I change it?


Or is this a Weather Display artefact?
« Last Edit: November 12, 2022, 01:32:11 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga template date settings
« Reply #1 on: November 11, 2022, 04:35:08 PM »
That message is from JavaScript, not a PHP setting.  Since you didn't include a URL to your site in the post or in your profile, I can't tell what weather software you're using.

The script you want to edit to use the 2-digit date is named ajax{XX}wx.js -- they all have similar construction, just use different sources of realtime data.  Let me know the URL of your website, and I can be more specific with modification instructions.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Vasco

  • Forecaster
  • *****
  • Posts: 342
    • PWS
Re: Saratoga template date settings
« Reply #2 on: November 11, 2022, 05:05:25 PM »
The script you want to edit to use the 2-digit date is named ajax{XX}wx.js -- they all have similar construction, just use different sources of realtime data.  Let me know the URL of your website, and I can be more specific with modification instructions.

Sorry, Ken, I posted about WD just before you replied. Site is now in profile. . . was hoping to wait until I'd got it right  :-)

I've just found some date/time settings in ajaxWDwx.php. . . down at line 887  :shock:  But they suggest I should see, e.g., Fri Nov 11, 2022. . .

BTW I don't mind H:i:s (s = clientraw #31) in the headings  :-)
« Last Edit: November 11, 2022, 05:27:21 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga template date settings
« Reply #3 on: November 11, 2022, 05:40:36 PM »
The ajaxWDwx.js doesn't really reprocess the date used in Weather-Display clientraw.txt file
Code: [Select]
var ajaxdateformat = clientraw[74]; so getting to a two-digit year for the AJAX updates on your site is not going to be easy.  the clientraw[74] looks like
Code: [Select]
11/11/2022 and the format depends on WD settings.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Vasco

  • Forecaster
  • *****
  • Posts: 342
    • PWS
Re: Saratoga template date settings
« Reply #4 on: November 11, 2022, 06:02:00 PM »
getting to a two-digit year for the AJAX updates on your site is not going to be easy.  the clientraw[74] looks like
Code: [Select]
11/11/2022 and the format depends on WD settings.

Thanks, Ken. I realise WD uses d/m/Y or m/d/Y as user settings, but now I know where to find it I'll have a go.
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 342
    • PWS
Re: Saratoga template date settings
« Reply #5 on: November 12, 2022, 09:18:03 AM »
Think I've cracked it, rather selfishly. Changed line 901 in ajaxWDwx.js
Code: [Select]
// var ajaxdateformat = clientraw[74];
var ajaxdateformat = clientraw[35] + "/" + clientraw[36] + "/" + [clientraw[141]-2000];

You guys across the pond might want to swap [35] and [36]  :-)

[Got rid of the @ shown in my first post, too. Now, if only I could get the colons to agree.]
« Last Edit: November 15, 2022, 12:24:50 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline Vasco

  • Forecaster
  • *****
  • Posts: 342
    • PWS
Re: Saratoga template date settings
« Reply #6 on: November 15, 2022, 12:19:21 PM »
[Got rid of the @ shown in my first post, too. Now, if only I could get the colons to agree.]

Fixed them both, now :-)  Changed line 372 of ajax-dashboard.php from

Code: [Select]
<span class="ajax" id="ajaxindicator"><?php langtrans("Updated"); ?>:</span>&nbsp;@
to
Code: [Select]
<span class="ajax" id="ajaxindicator"><?php langtrans("Updated"); ?></span>:&nbsp;

so no @ and position of colon agrees with line 105 of ajax-gizmo.php
« Last Edit: November 15, 2022, 12:24:35 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10