Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-08-2011, 11:50 AM   #1
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
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:
  • h : the hours without a leading 0 (0 to 11 or 0 to 23, depending on am/pm)
  • hh : the hours with a leading 0 (00 to 11 or 00 to 23, depending on am/pm) m : the minutes without a leading 0 (0 to 59)
  • mm : the minutes with a leading 0 (00 to 59)
  • s : the seconds without a leading 0 (0 to 59)
  • ss : the seconds with a leading 0 (00 to 59)
  • ap : use a 12-hour clock instead of a 24-hour clock, with "ap" replaced by the localized string for am or pm
  • AP : use a 12-hour clock instead of a 24-hour clock, with "AP" replaced by the localized string for AM or PM

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'
For this week, please post bugs/questions here. Once the changes are released and stable, bug reports will become preferred.
chaley is offline   Reply With Quote
Old 11-08-2011, 12:34 PM   #2
capnm
Groupie
capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'
 
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.
capnm is offline   Reply With Quote
Old 11-08-2011, 12:39 PM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capnm View Post
Specifically -- will a composite column such as {date} now sort on the date-time underlying "Date" instead of the visible mm/dd/yy?
No. It will sort on the data in the column, just as before. Of course, the data in the column depends on what the format string for the underlying date is.
Quote:
Will pubdate sort on the visible "yyyy" or the underlying, possibly misleading date-time?
No change in behavior -- it sorts on the date-time.
Quote:
Would it make sense to have a tweak regarding sort behavior -- sort on display vs sort on underlying date-time?
Make sense, but I would like to see the performance hit first. Also, you don't want to sort on the displayed value, because that would make things like Mar 22, 2001 come out after Apr 1, 2001.
chaley is offline   Reply With Quote
Old 11-08-2011, 02:37 PM   #4
capnm
Groupie
capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'
 
Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
Edit: This became a moot cross post -- chaley responded here

Many thanks chaley!

Last edited by capnm; 11-08-2011 at 02:49 PM.
capnm is offline   Reply With Quote
Old 11-08-2011, 03:01 PM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
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.
chaley is offline   Reply With Quote
Old 11-08-2011, 03:25 PM   #6
capnm
Groupie
capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'
 
Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
Quote:
Originally Posted by chaley View Post
... looking at a subset of the information does not always mean that it should sort that way.
Agreed.

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!
capnm is offline   Reply With Quote
Old 11-10-2011, 10:34 PM   #7
capnm
Groupie
capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'
 
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 ...
capnm is offline   Reply With Quote
Old 11-10-2011, 11:59 PM   #8
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by capnm View Post
Now it's obviously too late this time round, but am I correct that only released source is available as a tarball?
I'm guessing no.

Quote:
Originally Posted by capnm View Post
And that to get the unreleased 'trunk' I'd have to install bazaar (which I'm too lazy to do, at least yet)?
The instructions for setting up the development environment is here.
DoctorOhh is offline   Reply With Quote
Old 11-11-2011, 12:28 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, you need bzr to get unreleased source.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 08:47 PM.


MobileRead.com is a privately owned, operated and funded community.