![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,336
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Help requested from people running from source
I just made some changes to handling of dates in the GUI that might introduce "regressions" (OK, bugs). Kovid has merged the changes into 'trunk', and I would very much appreciate it if people who run from source could try it out before this week's release.
I have converted all dates in the GUI to date_time, which means that all date fields now contain a time as well. If the format permits showing times, then you can set and set the time. For the standard columns, the formats are set using tweaks. For custom date columns, the format is set by editing the column setup. There are behavior changes. The biggest is that when editing you will see only the fields that the format specifies. For example, if your pubdate format is "yyyy", when editing you will see only the year. Before, you would see the month and the year. If you change your timestamp format to "dd MMM yyy hh:mm:ss", then you will see and can change both the date and the time. You could also do this for pubdate, but I am not sure why you would want to. Another change: the tooltip for a cell will show the date + time, regardless of the format. The tweaks for the three standard date fields are gui_last_modified_display_format, gui_pubdate_display_format, and gui_timestamp_display_format. The time format options are:
Example: the values of the tweaks for testing are Code:
gui_last_modified_display_format = 'yyyy/MM/dd hh:mm:ss' gui_pubdate_display_format = 'yyyy' gui_timestamp_display_format = 'dd MMM yyyy hh:mm' |
![]() |
![]() |
![]() |
#2 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
|
Hmmm....
How does this affect my question here ? Specifically -- will a composite column such as {date} now sort on the date-time underlying "Date" instead of the visible mm/dd/yy? Will pubdate sort on the visible "yyyy" or the underlying, possibly misleading date-time? Would it make sense to have a tweak regarding sort behavior -- sort on display vs sort on underlying date-time? (It's when you're doing nested sorts that it matters). Edit: I guess my preferred behavior would be to have dates sort on what is displayed, but as though they were dates, not just text. Last edited by capnm; 11-08-2011 at 12:39 PM. |
![]() |
![]() |
![]() |
#3 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,336
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,336
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I understand what you want to do, and I think I answered the question on your other post. I am not totally convinced that the behavior you want is correct, but I am willing to go along with it. Reason for doubt: looking at a subset of the information does not always mean that it should sort that way. For example, consider a net-worth column. Should it sort by pennies because that is what I am looking at, or should it respect the 'real' net worth? Arguments exist on both sides.
Also, sorting the {date} column does sort as a date-time. The parts that are not shown are set to some default, which depending on the template may cause the sort to behave as you want. As I said, I am willing to go with the 'sort by what I see' position if Kovid is. Repeating that other post here for completeness: I have an implementation that sorts dates as displayed. The performance penalty is not huge. For a 20,000 book library, the time to sort by a date column went from approximately 1/2 second to 1 second, or some 500 microseconds per book. This is consistent with my mark 1 eyeball estimate of the cost of trimming the date. [...] One note: the sort will respect strange display templates and do something. If your display template is, for example yyyy/ss, then the month, day, hour, and minute will be filled in with a constant. The results could easily not be what you expect. Continuing the example, 2011/10/25 19:08:10 and 2011/01/19 10:10:10 will sort as equal because the years (2011) and the seconds (10) match. |
![]() |
![]() |
![]() |
#6 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
|
Quote:
And if I were sorting only on a date column, I'd probably prefer as granular a sort as possible, minimizing 'randomness' of the result. That's what I like about your implementation -- I can have my cake and eat it too! If I want a date sorted to the second, I just display it so. (Actually what you've implemented is even better, I determine the sort granularity with the display format tweak, but I can still refine the appearance by adjusting the display column width -- so I can sort to the second while displaying only the day). If I want a different date less granular to facilitate nested sorts I display (format tweak) it accordingly. If I'm willing to take the hit of restarting calibre, I can even switch back and forth! (Though I can't really imagine wanting to do that). I like it! |
|
![]() |
![]() |
![]() |
#7 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
|
Okay, chaley, I'm feeling a little guilty here, since there's no evidence of anyone, including me, testing the source ...
Now it's obviously too late this time round, but am I correct that only released source is available as a tarball? And that to get the unreleased 'trunk' I'd have to install bazaar (which I'm too lazy to do, at least yet)? Thanks ... |
![]() |
![]() |
![]() |
#8 | ||
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,889
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,188
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes, you need bzr to get unreleased source.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
For people running calibre from source | kovidgoyal | Calibre | 4 | 08-19-2011 04:28 PM |
Error while running calibre with source | Lev667 | Development | 3 | 03-05-2011 09:55 AM |
Running from source after V0.7.32 | chaley | Calibre | 0 | 12-04-2010 12:08 PM |
Free (Kindle) Reaching people under 40 while keeping people over 60 (Christian) | arcadata | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 10-17-2010 07:58 AM |
Note for those running from source and 0.7.2 | chaley | Calibre | 1 | 06-12-2010 08:19 AM |