Author Topic: Journal Date/Time format question  (Read 1871 times)

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Journal Date/Time format question
« on: November 03, 2015, 12:57:48 AM »
I added a few Journal entries, even a page that I might add to my site. First few last month went fine. However, today I decided to add some "Retro" entries. I didn't notice right away, but the times seem to calculate my entries instead of letting me use pm/PM.

I'm sure you remember the text in the drop-down date/time entry dialog:
"Please enter the date and time for the entry. For example ?yesterday, 1:15 pm?."

Assumptions (based on the current date of 2-Nov-2015):
  • ?yesterday? will be processed by WC and appear as ?1-Nov-2015?
  • a comma will remain-right after the date
  • ?1:15 pm? will not be changed
Are these assumptions incorrect for ?Retrospective? entries? It seems that #3 (time) reverts to a 24 hour value and drops any of the (now) un-needed ?am/AM/pm/PM? parts.

Perhaps I?m discovering these rules because I?m adding a few ?Retro? entries. Perhaps my assumptions are simply in ever. Perhaps no one else even cares!
DETAILS!
Details!
details... [banghead]
I can edit the ~/Library/WeatherCatData/Location1/Journal.xml file, however. Quit/Restart WC gets it to re-read the xml file so the Journal Tool will show the changes I made to it. Might be easier to simply use that file for any more "Retro" entries. Probably lose of your erer cheqing, however[lol]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: Journal Date/Time format question
« Reply #1 on: November 03, 2015, 11:10:46 PM »
No need to edit the XML file. It will only get re-written every time WC processes the file calling for the Journal entries. :) Took me a while to discover this... mainly because I'm so dense! [rockon]

Also discovered that many html items can be included in the Journal text entry. The example in the Manual for inserting an image led me to believe one needed to single quotes and maybe double-quotes inside other double-quotes could be a problem.

I was also confused to see what happened to html 'code' when the XML file was created. I thought for a while I would have to convert "<" and ">" to the ASCII equivalents of "&lt;" and "&gt;" in the actual Journal entries! That was completely erroneous on my part. [banghead] Just type in the 'html' where you want it and let WC do the converting, where required. I'm just more used to trying to make things as hard as possible... [rolleyes2]

WC uses lots of 'line break' html (<br>) and that appears not to be controllable; it's hard-coded into the app. However, one can use negative margins (as distasteful as that is to most CSS purists) to close up the spacing. Here's what my current Journal page looks like. The indention, font styling, and rules are all simple html with CSS classes or 'style' settings. They are all simply typed into the Journal entries when first created or later.

One thing that seems to still require editing the XML file is the default "PM" that gets added to afternnon times. Making that edit in the XML seems to stick. Editing can also be used to change the default 24 hour clock times when entering a "Retrospective" date/time. The edits will also appear in the Journal Tool after Quitting WC and starting it again; fortunately the app reads the XML each time it starts! [cheer] This, to me, is a minor annoyance and is mainly a factor after adding a "Retrospective" entry, probably a rare occurrence for most users.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Can't find the manual section! (Re: Journal Date/Time format question)
« Reply #2 on: November 03, 2015, 11:58:27 PM »
Dear X-Air and WeatherCat readers of that fine example of English literature: the WeatherCat manual.

Sufferin' Succotash!!
. . .  I know there is something about it in the manual but I can't find it! . . .

I thought there was quick discussion of what sort of natural language WeatherCat could cope with when entering an date and time.  I thought it was associated with making a query of the database, but I don't see it in that section.

Does anybody remember what Stu has to say about that?

Cheers, Edouard

P.S. One thing that might work out better for you journal entries is to use 24 hour time.   

;) . . . Besides that what they use in all that military and superhero stuff!! . .  [lol2]

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: Journal Date/Time format question
« Reply #3 on: November 04, 2015, 12:03:00 AM »
The info I found (other than the tag$) is on pages 60 and 61.

Speaking of tag$, Stu allows us ONLY 9,999 journal entries! At least with the COUNTEDJOURNT$ tag. That's not even a computerese number!!!
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Bull Winkus

  • Storm
  • *****
  • Posts: 782
    • EW0095
    • KARHORSE2
    • WU for Horseshoe Bend, Arkansas
  • Station Details: Davis Wireless Vantage Pro 2, iMac 24"
Re: Journal Date/Time format question
« Reply #4 on: November 04, 2015, 06:15:32 PM »
I think it might be better to have the ability to launch a journal, kept in an alternate word processor or dedicated journalling program. That would give the journal the option of RTF in whatever app the operator chooses.

Am I dreaming up stupid stuff again? Seems like this would make the Cat leaner while the under utilized Journal could get bigger.

Herb

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: Journal Date/Time format question
« Reply #5 on: November 04, 2015, 11:52:12 PM »
I'l let Stu speak to the "leaner" part. However, no matter where the Journal is stored or what its format, WC will eventually have to parse the text into the Journal display. In addition, RTF (and even worse, Word, Pages, and every other word processor) adds formatting info which then has to be discarded or converted to html tags. That could add a lot of code to WC and may even require licensing costs for Stu.

With the current method, he already knows the exact format (plain text) which makes the parsing very simple. The app 'simply' adds "<BR>" and "<B>" html 'tags' to help differentiate the date/time from the Journal text.

In fact, between every entry there is the following html: "<BR><BR><BR>" This forces three line breaks between each entry. It looked excessive on my screen. That's why I looked into adding my own CSS to 'clean' out those blank lines.

We can't remove the html that WC adds, but we can add html with or without css that move the text up almost as much as you want, thus filling the blank lines with useful text. That's what I did with the "<hr>" tags; I simply put css in them to create negative top and bottom margins. Also used a "<span>", with added css, to make the 'path' a different size and font-family.

All this added stuff is simple, plain, html and css. It can be entered directly in the Journal entry.

Frankly, if you can use the 'full editor' here, you are already more than half way to creating html documents. With just a very small extra bit of typing, you can easily write both html and css to make some fairly major styling changes. You can even do that with at least some of the "templates". [cheer] As my real-life, programmer son says, "After all 'programming' is just typing!" [lol2]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: Journal Date/Time format question
« Reply #6 on: December 14, 2015, 08:42:54 PM »
"Editing" a Journal entry is slightly less intuitive than 'editing' other documents you may have done before. Actually, you can edit the journal description/text part just about any way you want in the Journal Tool. However, it seems that WC "sees" 'viewing' of a particular entry as cause to re-publish that entry in the XML file.

For example;
In the Journal window, I double-click some current journal item to copy the description so it can be pasted into a new entry. I now create that new entry the normal way, WC supplies the date/time and I paste in the copied description and change it as appropriate. Click the Close button. Wait for the new data to be uploaded and view it on my site. There's my new entry, in all its glory!

However, I now notice that the Journal that I had double-clicked, in order to copy the text, now shows the date/time info the way WC wants; 1) No comma between the date and time, 2) a 24 hour time with the redundant "AM" or "PM". Even though I had not "edited" anything in the older journal entry, I believe WC notes my viewing/opening of it by setting a "change" flag for that entry. Not really a bug, after all, Stu has provided a perfectly capable method of adding journal entries and has even created a method of inserting the time automagically! This is simply how it's designed. Plus, I am probably one of only two clowns who actually want the date/time format a little different! [banghead] Therefore, the only people who will see this behavior are me and that one other user. [lol] I am not asking for any changes, I will simply create new entries by directly editing the journal.xml file. It's faster than using the Journal tool and then correcting the date/time settings in any of the entries WC patiently and obediently tries to return to the "proper" format! [removed link to the now castly photobucket.com site]
« Last Edit: December 30, 2017, 05:27:12 PM by xairbusdriver »
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system