Page 1 of 1

monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 1:55 pm
by ajcm
Hello:

It has arisen a new problem for me with the new template "monthlyrecordT" because the month name is in Spanish because it takes the data from windows system.

For example:
In the template "thismonthT" the date format was "<# MonthTempHT> on <# MonthTempHD>"
- http://acanmet.com/GC100/thismonth.htm and replace with "<# MonthTempHT format = hh: mm> on <# MonthTempHD format = dd / mm / yyyy> ", but now the problem is that the format is" <# ByMonthTempHT mon = 1> ".
- http://acanmet.com/GC100/monthlyrecord.htm
I would like to know how to format "format = hh: mm" and "format = dd/ mm/yyyy".

And because of this post you commented on the subject of that from precipitation of 1 mm is considered wet day and less than 1 mm is dry, it appears that on April 8th day it rained 4.4 mm, then this day should have been put to 0 the days of drought but it is still counting and today April 15th is now in 361 Days Since It Last Rained. Let's see if I can say something about it.

Thank you very much and I hope your answer.

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 2:21 pm
by steve
ajcm wrote:I would like to know how to format "format = hh: mm"
<# ByMonthTempHT mon=1 format="hh: nn">
and "format = dd/ mm/yyyy".
<# ByMonthTempHT mon=1 format="dd/ mm/yyyy">
And because of this post you commented on the subject of that from precipitation of 1 mm is considered wet day and less than 1 mm is dry, it appears that on April 8th day it rained 4.4 mm, then this day should have been put to 0 the days of drought but it is still counting and today April 15th is now in 361 Days Since It Last Rained.
It uses 0.2 mm by default, not 1 mm, or whatever you've set it to if you've set it. If you zip up the diags folder, dayfile.txt, and today.ini and attach them, I'll take a look.

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 5:20 pm
by ajcm
I change format here:

<tr class="td_temperature_data">
<td class="main_table_text_labels">Highest&nbsp;Temperature</td>
<td class="right_align_indented"><span id=TempH><#ByMonthTempH mon=1></span>&nbsp;<#tempunit></td>
<td class="right_align_indented"><span id=TempHT>at <#ByMonthTempHT mon=1 format="hh:mm"> on <#ByMonthTempHT mon=1 format="dd/mm/yyyy">

But if you click up on the monthnames it appears as before. I think that it must change here:

var hightempT = new Array("<#ByMonthTempHT mon=1>","<#ByMonthTempHT mon=2>","<#ByMonthTempHT mon=3>","<#ByMonthTempHT mon=4>","<#ByMonthTempHT mon=5>".....................................

But must I change every data, one and one?

anyway do not think I just leave well: " at 14:10 on 12/01/2004 "

I really do not want this format "hh:mm dd/mm/yyyy", what I want is for me to appear in English not Spanish. No other way?

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 5:24 pm
by steve
ajcm wrote:But must I change every data, one and one?
Yes; see the other thread where all of this has been discussed. You have to specify the parameter each time you use a web tag.

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 5:28 pm
by steve
ajcm wrote:what I want is for me to appear in English not Spanish. No other way?
I can't win. I get people complaining that Cumulus is only in English, so I try to make it work in their own language and I still get complaints. More options needed, I guess.

Use the "monthnames" array and a web tag with format=m to index it - like the code that sets "Records for the month of..."

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 5:53 pm
by ajcm
Ok, sorry, I understand perfectly but I demand nothing I myself am content to leave it in the English language that is international. I always think that a program will work most perfect in the language of the factories that if you change the language then you can run worse.

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 6:01 pm
by ajcm
steve wrote: Use the "monthnames" array and a web tag with format=m to index it - like the code that sets "Records for the month of..."
You mean to put a format here?

var monthnames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");

If but where and how.

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 6:52 pm
by steve
Create a <span id=HTMonthName> and set it to monthnames[month] in the changeData function:

document.getElementById('HTMonthName').innerHTML = monthnames[month];

Set the other parts of the date using format parameters with <#ByMonthTempHT...

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 7:21 pm
by ajcm
I change this:

function changeData(month) {
document.getElementById('MonthName').innerHTML = monthnames[month];
document.getElementById('HTMonthName').innerHTML = monthnames[month];
document.getElementById('TempH').innerHTML = hightemp[month];

<caption>Records for the month of <span id=HTMonthName>January</span></caption>

The months don“t move.

Do not worry anymore because I do not know html programming and do not want to waste anymore of your time.

Thanks Steve.

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 8:16 pm
by steve
But you've changed the ID of the one that gets changed anyway, so it has no effect. You need to do the same thing for the other dates, where you currently get "enero" - in the table itself, not the caption.
Do not worry anymore because I do not know html programming
This is really javascript rather than html, and I don't know much of either of those, but I like to learn. I had to learn a few things to create the monthlyrecordT.htm template in the first place.

Re: monthlyrecordT: how to change the date and time format.

Posted: Sun 15 Apr 2012 9:55 pm
by ajcm
Ok, Steve, I'll try when I have time these days.