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
Date attributes (Read 1465 times)
Steve Hodgson
Full Member
*
Offline



Posts: 12

Date attributes
Jan 11th, 2016, 3:46pm
 
Forgive me if this is a newbie question. Iím still getting my head round much of what TB can do.

Is it possible to have a date attribute that doesn't include times? When I add dates I always get something like "14/03/2014, 20:34"
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Date attributes
Reply #1 - Jan 11th, 2016, 5:11pm
 
Date-type attirbutes inherently include a time, thugh you can choose not to display it, e.g. in key attributes. Also some actions let you test durations in whole days/months/years rather than times.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Steve Hodgson
Full Member
*
Offline



Posts: 12

Re: Date attributes
Reply #2 - Jan 11th, 2016, 5:33pm
 
I take it you mean the whole date & time can be hidden using key attributes and not just the time?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Date attributes
Reply #3 - Jan 12th, 2016, 3:54am
 
Um, no.  Key Attributes (KA) are a table of attributes chosen/modified by the user displayed about the $Text of a given note. The items in the KA table can be disceet to a single note or inherited via a preference, etc - the listing in the table is an atribute itself.

You can customise how Date (i.e. Date/Time) type data is shown in a KA listing, using the Document Settings Text tab.

When setting a Date attribute, if you don't specify hrs:mins Tinderbox uses the current system time, with 00 seconds.  The 'now' and 'today' designators use current hh:mm:ss time.

Either way, in general the time element doesn't make any difference to using dates. I think perhaps you're actually trying to ask a different question - that of forcing Date values to use a consistent time (i.e. 00:00:00 or 12:00:00) for all notes. Is this so?
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Steve Hodgson
Full Member
*
Offline



Posts: 12

Re: Date attributes
Reply #4 - Jan 12th, 2016, 4:08am
 
Thanks for that. It's more the case that I'm recording an historical date value for which time is irrelevant. For that reason I'd rather not record it or simply hide it via formatting.

I'd be interested in learning that technique
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Date attributes
Reply #5 - Jan 12th, 2016, 5:09am
 
For setting a format in the KA table see the link in my last post.  If the offered choices don't suit, you can set you own $KeyAttributeDateFormat using elements from the app's date format syntax. You may also want to look at the .format() action code, specifically in the Date.format() or format() contexts. As you will see, there is normally more than one way to do things in Tinderbox and thus no 'right' to do things. Pick the method with which you feel most comfortable.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Steve Hodgson
Full Member
*
Offline



Posts: 12

Re: Date attributes
Reply #6 - Jan 12th, 2016, 7:33am
 
Thanks, I'll check this out tonight once I'm back at my Mac
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Date attributes
Reply #7 - Jan 12th, 2016, 8:22am
 
Date-time objects are, under the hood, the number of milliseconds from a reference date (often the Unix epoch) and then rendered as necessary. It makes date/time arithmetic easy - well excepting leap years, time zones, public holidays (i.e. # work days), different calendars, etc.

Partial dates like Caesar at the Rubicon in 49 CE, of Britain adopting a short month while adopting the Gregorian Calendar in September 1752 work fine as text (String attributes) as we don't have to guess the missing time or date elements. However, date arithmetic is then harder. Timeline events do need a valid Date attribute in order to plot. If just storing years you could use either String or Number type. However as numbers render in some places with decimal places, 1917.00 might look odd for the date of Vimy Ridge (in 1917).

[Edit: Fixing some auto-correct spelling errors]
Back to top
 
« Last Edit: Jan 12th, 2016, 5:48pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Steve Hodgson
Full Member
*
Offline



Posts: 12

Re: Date attributes
Reply #8 - Jan 12th, 2016, 4:04pm
 
Thanks for the tip about Document Settings. Worked perfectly and it's reassuring to know it wasn't there when I started to learn Tinderbox.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print