Page 1 of 1

two questions <#LastRainTipISO> and auto refresh

Posted: Tue 31 Jan 2012 12:40 pm
by dezzeer
Hi all question 1 is there away to show the date for rain tip tag as 13:45 on 21 Jan instead of 2012-01-30 06:21
question 2 is i can get all my tags to auto refresh using the <span id tag but cant seem to get the since midnight and last 24hrs.
many thanks Darron

Re: two questions <#LastRainTipISO> and auto refresh

Posted: Tue 31 Jan 2012 12:45 pm
by steve
dezzeer wrote:Hi all question 1 is there away to show the date for rain tip tag as 13:45 on 21 Jan instead of 2012-01-30 06:21
Yes, see the 'format' parameter in the help for the web tags.
question 2 is i can get all my tags to auto refresh using the <span id tag but cant seem to get the since midnight and last 24hrs.
I'm not familiar with this technique; hopefully someone else can help.

Re: two questions <#LastRainTipISO> and auto refresh

Posted: Tue 31 Jan 2012 2:09 pm
by beteljuice
You don't give a link to your site nor tell us whose flavour of AJAX code you are using !

If the AJAX code is parsing realtime.txt then there are no entries for (rain) since midnight, or (rain) last 24.

However if your station 'day' begins midnight, then there is rain today entry (#10 or array[9])

Re: two questions <#LastRainTipISO> and auto refresh

Posted: Tue 31 Jan 2012 3:03 pm
by dezzeer
my website is on http://www.dazmather.co.uk
cheers
sorry about this but would the code look something like this
<#LastRainTipISO>format="dd/mmm/yy">
a bit confused many thanks again

Re: two questions <#LastRainTipISO> and auto refresh

Posted: Tue 31 Jan 2012 4:08 pm
by steve
dezzeer wrote:<#LastRainTipISO>format="dd/mmm/yy">
<#LastRainTipISO format="dd/mmm/yy"> (note the syntax) would give you (e.g.) 31/Jan/12

If you want "13:45 on 21 Jan" you need

<#LastRainTipISO format="hh:mm 'on' dd mmm">

or

<#LastRainTipISO format="hh:mm 'on' d mmm">

if you don't want a leading zero on single-digit days.

Re: two questions <#LastRainTipISO> and auto refresh

Posted: Wed 01 Feb 2012 11:06 am
by dezzeer
hi steve thanks.
got one small issue it seems to be putting a slightly bigger background colour on the display for the date.
www.dazmather.co.uk

<tr class="td_rainfall_data">
<td>Rainfall&nbsp;Last Hour</td>
<td><span id="rhour"></span>&nbsp;<#rainunit></td>
<td>Last rainfall</td>
<td><#LastRainTipISO format="hh:mm 'on' dd mmmm"><td>
</tr>
thanks again Darron

Re: two questions <#LastRainTipISO> and auto refresh

Posted: Wed 01 Feb 2012 11:12 am
by steve
There's an error in your html:

<td><#LastRainTipISO format="hh:mm 'on' dd mmmm"><td>

should be

<td><#LastRainTipISO format="hh:mm 'on' dd mmmm"></td>

Re: two questions <#LastRainTipISO> and auto refresh

Posted: Wed 01 Feb 2012 12:12 pm
by dezzeer
thanks steve once again must look more closely next time.

cheers Darron