Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
problem with dates (Read 6733 times)
Talal
Full Member
*
Offline



Posts: 56

problem with dates
Feb 14th, 2008, 5:43pm
 
I can't seem to get the start and end dates to show more than two numbers for the year; for example, when i type 1/1/1980, it becomes 1/1/80. As I am trying to make a timeline that goes back to the medieval period, this is not helpful. For what it's worth, I'm running os x 10.5.2, the latest tbx, and my international settings are those of the UK, in which the date format is xx/xx/xxxx.
Back to top
 
« Last Edit: Feb 14th, 2008, 5:44pm by Talal »  
  IP Logged
Allan Tsai
Full Member
*
Offline



Posts: 41

Re: problem with dates
Reply #1 - Feb 14th, 2008, 8:22pm
 
Which start and end dates are you referring to?
Are these default attributes? Or attributes that you created?

I created a template for diary/journal use and I am using custom date formats that show something like "Monday, January 21, 2008 9:41 AM".

To do this:
- I created a new attribute called "date" (you can name it whatever you want though) and set its type as "string."
- Then I created a new prototype note and set "date" as a key attribute.
- Finally, I added to the rules of this prototype "$Date=(format($Created, "W, MM d, y H:mm p"))"

Now whenever I create a new note based on that prototype, my "Date" attribute is takes the "Created" value into whatever format I specify.

See the Tinderbox Manual page 274 in Appendix 5 on specifying your own date format.

Not sure if this answers your question, but hopefully it'll at least give you some hints Smiley
Back to top
 
« Last Edit: Feb 14th, 2008, 8:23pm by Allan Tsai »  

Tinderbox 4.7.1
Macbook Pro 2.4Ghz Intel Core 2 Duo, 4GB RAM
OS X 10.6.1
  IP Logged
Talal
Full Member
*
Offline



Posts: 56

Re: problem with dates
Reply #2 - Feb 14th, 2008, 8:51pm
 
Allan, thanks for the reply. My silliness: I didn't contextualize what I was doing. I was using the timeline kit provided on the exchange page; to use timeline, you set the start and end date, both of which use attribute types "date". But regardless, even when not using that kit, but just a brand new tinderbox file, trying to make a user custom field using the "date" attribute type still won't work for me, as described above. I'll try what you said, but I still don't think I understand: is there something I need to do in order to use the full four digit year date, in a date attribute?
Back to top
 
« Last Edit: Feb 14th, 2008, 8:52pm by Talal »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: problem with dates
Reply #3 - Feb 15th, 2008, 6:36am
 
Attribute names are case sensitive, in Allan post I suspect the attribute is "Date" not "date" thoughout.

I've just run out the demo on a UK system and all works.

To create an attribute called "Date":
  • Open the Attributes panel (Cmd+2)
  • If the User tab of the panel is not active, click it.
  • Click the 'Create' button, an Attribute dialog opens.
  • In the 'name' box, type 'Date'.
  • click the 'type' pop-up and select 'date'
  • Leave the 'default value' box empty (FWIW it internally defaults to 'never').
  • Click 'OK'. Your new attribute has been created.
Where in TB are you seeing the dates as 'wrong'? If it is in a note's Key Attributes listing, then you can't alter that.

On a UK system any date-type attributes are shown in Key Attributes using (d)d/(m)m/yy hh:mm which doesn't actually follow the UK short data setting (of dd/mm/yyyy) although my understanding is (was!) that TB uses the host system's short date setting for displaying dates.

Odd, in testing (UK setting OS 10.4.11, TB v4.1) I've input a date to a date-type attribute called MyDate with the string "5 Sep 1240 15:45". As a note key attribute MyDate displays "5/9/40 15:45"
The note's Rule sets string attribute called TrueDate:
     TrueDate=format($MyDate,"D/M0/y h:mm")
I see "31/07/1904 16:09" in the key attributes display.
However, I should see "05/09/1240 15:45"

OK, even if there's currently something odd going on with the display of dates inside TB, the timeline export works fine - or does for me. If you're porblem is with the long date format seen in the event info boxes in the timeline, then you want to change the date format set in the 'event' template where the "*" format string outputs RFC 822 styled date/time strings, e.g. ^get(end,"*"). BUT... bear in mind this date is used both for display in the right timeline location (so I believe) as well as for display in the event's screen popup. If you export a date for screen reading that can't be parsed to a valid Javascript date then the timeline display may fail.  you may need to dive into the Timeline project's Javascript (i.e. not the stub code in the TBX). My hunch is you're safe as long as your chosen format for screen display can create a valid Javascript date object; luckily that's easily tested as a standalone JS test.

[post edit] Further to the above re allowable date formats, the Dinosaur example over at the SIMILE site uses plain numbers for 'start' and 'end' that are interpreted as 'MA' units (millions of years?). To do similar you would need to tweak the Timeline initiation JS code in the sample TBX (note name = "/boilerplate/script"), but it indicates a lot of customisation can be done!
Back to top
 
« Last Edit: Jul 15th, 2008, 4:07am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: problem with dates
Reply #4 - Feb 15th, 2008, 9:22am
 
When Tinderbox displays Key Attributes, it uses the system's "short local" date format.  In the standard US setting, this gives you two-digit year dates; if you work with dates before 1904, you probably want to set this to a four-digit year date.  It's a System Preferences setting (International panel, Formats pane)

When exporting dates before 1904 in Tinderbox 4.1 using a custom format (e.g. "d M y"), the wrong date may be exported.  For the time being, use "l", "L", or "*" formats.  This is fixed in the next release.
Back to top
 
 
WWW   IP Logged
Talal
Full Member
*
Offline



Posts: 56

Re: problem with dates
Reply #5 - Feb 15th, 2008, 5:50pm
 
Despite my many thanks to Mark Anderson, I don't want to have to jump hoops, primarily because I want to use the notes/entries in my tbx file to (a) export to Timeline, but also (b) use the information *as is* in tinderbox, and perhaps then export that map view using Nate Matias' webviewer. As such, the dates have to be correct, uniform, and with as little fiddling as possible. I guess I'll wait to see how the next release goes. Thanks again.
Back to top
 
« Last Edit: Feb 16th, 2008, 9:12am by Talal »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: problem with dates
Reply #6 - Feb 15th, 2008, 6:41pm
 
The issue with format() is being fixed but it doesn't affect the 2-digit/4-digit display issue inside Tinderbox. Rest assured the date data's stored correctly but there appears to be a separate issue with UK OS settings ((other counties) as opposed to US settings - please re-read my earlier note or we'll just go round in circles. If there is an issue with different international settings it may take a while to chase down so please don't assume a fix is an instant one.
Back to top
 
« Last Edit: Feb 16th, 2008, 6:26am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print