View Single Post
Old 04-11-2020, 01:22 AM   #10
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
You can try (with a change of the column. I'm using the Date column here as it is in all libraries):

Code:
program:
format_date(raw_field('timestamp'),'yyyy-MM-dd')
But, I doubt if it will do what you really want. And that what is missing in the thread.

What are you actually trying to achieve? It is one thing to put the column in the tag browser, but, that's pretty pointless if all values are unique. And, as the date is stored as a timestamp, it will probably be fairly unique. And while the above would show an entry for each day, how many books do you finish on a single day? For my main library, there will be plenty of days that don't have an entry, and very few that have more than one. I do have a library that is basically short stories. That can have multiple books finished on a day.

The useful thing I can think of is to see a tree in the tag browser to to group based on the elements in the date. That way you could then get an entry for the year, with sub entries for the month and then day. The counts at each level would show how many books were finished in that time period. For this:

Code:
program:
format_date(raw_field('timestamp'),'yyyy.MM.dd')
And set the column as one that is a hierarchical item (Preferences, Look & Feel, Tag browser). You might also need to look at the category partitioning used.

But, I think I'd go with:

Code:
program:
format_date(raw_field('timestamp'),'yyyy.MM')
As I'm not sure the day is useful here.

The date formatting string can be changed to use month names ("MMM" for abbreviations such as "Apr" or "MMMM" for the full name), but, they mess up the sorting.

The above should give you some ideas. But, if you are after something else, then you need to explain what it is you are trying to achieve.
davidfor is offline   Reply With Quote