entering date field in calibre
-
I am using calibre.app on a macbook pro and have found a very small issue with date entry. I asked calibre support and was told that the date entry in managed by Qt so I'm asking the same question here.
I often change the "date" field on an entry and I have noticed a very slight anomaly. When entering the date, I start with the day number as 2 digits and the cursor jumps to the month field. I then start entering the month name and for most months I only need 3 chars, e.g. Jan or Feb, and the cursor then jumps to the year field. However, if the month is June, July or September, I need to enter 4 chars before the cursor moves to the year field, even though Jun, Jul and Sep are unique ways to write month names. Then, after I have finished entering the whole date, the displayed date shows the 3 char value of Jun, Jul & Sep.
Can we please have Jun, Jul & Sep accepted as valid input for month names?Thanks
-
I am using calibre.app on a macbook pro and have found a very small issue with date entry. I asked calibre support and was told that the date entry in managed by Qt so I'm asking the same question here.
I often change the "date" field on an entry and I have noticed a very slight anomaly. When entering the date, I start with the day number as 2 digits and the cursor jumps to the month field. I then start entering the month name and for most months I only need 3 chars, e.g. Jan or Feb, and the cursor then jumps to the year field. However, if the month is June, July or September, I need to enter 4 chars before the cursor moves to the year field, even though Jun, Jul and Sep are unique ways to write month names. Then, after I have finished entering the whole date, the displayed date shows the 3 char value of Jun, Jul & Sep.
Can we please have Jun, Jul & Sep accepted as valid input for month names?Thanks
Hi and welcome,
from your post I assume you are just a user of calibre app and no Qt dev, right?!
Can we please have Jun, Jul & Sep accepted as valid input for month names?
The question is:
What widgets do "they" (calibre developers) use there?! Standard widgets or self-developed ones.That being said, I don't think it's a Qt issue ifself rather than how calibre implemented the calendar logic and defined valid inputs.
Edit:
Found the repo on github:
Ok, they are using PySide6 and
QCalendar
/QCalendarWidget
.
I guess they have to change some settings to allow three letter inputs for month names.(@Steven123 here would be an example of a Python-based app using Qt frontend)
-
Hi and welcome,
from your post I assume you are just a user of calibre app and no Qt dev, right?!
Can we please have Jun, Jul & Sep accepted as valid input for month names?
The question is:
What widgets do "they" (calibre developers) use there?! Standard widgets or self-developed ones.That being said, I don't think it's a Qt issue ifself rather than how calibre implemented the calendar logic and defined valid inputs.
Edit:
Found the repo on github:
Ok, they are using PySide6 and
QCalendar
/QCalendarWidget
.
I guess they have to change some settings to allow three letter inputs for month names.(@Steven123 here would be an example of a Python-based app using Qt frontend)
@Pl45m4 said in entering date field in calibre:
Yes, I am just a user of calibre. I have posted your reply on their support page.
Thank you. -
@Pl45m4 said in entering date field in calibre:
Yes, I am just a user of calibre. I have posted your reply on their support page.
Thank you.Another thought:
Are you sure there is something wrong?
Maybe the month field is "three letters min, four letters at max"?!
So the automatic jump to the next input happens after a maximum number of four characters were inserted, and then it still displayed the more or less standard short form for months in three letters.Haven't checked the code any deeper, but for example an input validator can be different from what is displayed.
So both
Jun (3 letters, then manually tabbing or moving to next input) June (4 letters, max letter limit reached, cursor jumps/tabs automatically to next field)
would result in correctly setting the 6th month of the year, while
Jun
is displayed (based on your app's and OS' locale/language config)
-
A QDateEdit does not allow entering the month by name so it must be a custom widget.
-
I posted your reply to calibre support and they replied with:
It's likely locale dependent and calibre uses bog standard qt provided widgets for this, no custom settings.
I'm running on a MacBook Pro Sequoia 15.5 with Region: Australia and Date format: yyyy-mm-dd.
- I have changed Date format to dd/mm/yyyy but issue is same
- I have changed Region to United Kingdom but issue is same
- I have changed Region to United States but issue is same
-
A QDateEdit does not allow entering the month by name so it must be a custom widget.
@Christian-Ehrlicher said in entering date field in calibre:
A QDateEdit does not allow entering the month by name so it must be a custom widget.
Actually it does! (Though docs do not mention it and I cannot find a single post on web asking about month-name-text-input.) Although I have not tried to install the massive calibre project I can guess they are using
QDateTimeEdit.setDisplayFormat("MMM d yy")
(or similar, anything withMMM
). Not only does this cause the month to be displayed by name instead of number, it also allows user to type first alphabetic characters of a month to change to that month. I see same behaviour whetherQDateTimeEdit
or justQDateEdit
.Then I do see exactly the same behaviour/"inconsistency" as @RedOchre reports: if I type in, say,
Jan
as I hit then
at the end the cursor jumps on to the next field, but if I type in, say,Sep
nothing happens when I type thep
, but if I then proceed to typet
the fullSept
appear in the month and only then does the cursor move on to the next field. So some months require 3 characters for "auto-complete" while some require 4. As reported by the OP, and for no apparent reason. I did not go delving into the source ofQDate[Time]Edit
. [Actually I have had a look around https://codebrowser.dev/qt5/qtbase/src/widgets/widgets/qdatetimeedit.cpp.html now but did not spot anything about where the conversion/parsing of input month names is happening, so over to you Christian :) ]BTW I am Ubuntu and Qt 6.4 or 6.5 I think, and of course UK system format, so it does happen on other platforms than OP's MacOS.
-
With Qt6.9 I can only reproduce it with September:
QApplication a(argc, argv); QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedKingdom)); QDateTimeEdit edit; edit.setDisplayFormat("MMM d yy"); edit.show(); return a.exec();
/edit: and this is correct according to https://web.library.yale.edu/cataloging/months - it's Sept, not Sep
So all is fine here with Qt6.9
-
With Qt6.9 I can only reproduce it with September:
QApplication a(argc, argv); QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedKingdom)); QDateTimeEdit edit; edit.setDisplayFormat("MMM d yy"); edit.show(); return a.exec();
/edit: and this is correct according to https://web.library.yale.edu/cataloging/months - it's Sept, not Sep
So all is fine here with Qt6.9
@Christian-Ehrlicher
I did not try any months other thanJan
andSep
! I agree with you: unlike @RedOchre'sHowever, if the month is June, July or September, I need to enter 4 chars before the cursor moves
I find
Jun
&Jul
fine, onlySep
does not work./edit: and this is correct according to https://web.library.yale.edu/cataloging/months - it's Sept, not Sep
Indeed! But
- I am interested what is that document and how does it relate to what code which Qt is using for
QDate[Time]Edit
- That document actually indicates that
June
&July
should require 4 letters likeSept
, which is as the OP reports but not as you & find. - Why in the world should e.g.
Sept
require 4 letters as its abbreviation in any case?!
- I am interested what is that document and how does it relate to what code which Qt is using for
-
June and July work with Qt6. 9
-
June and July work with Qt6. 9
@Christian-Ehrlicher
I agreed with that above, at my Qt 6.4 or 6.5 too. ButSept
is still required, why, and ooi what call where is Qt using which uses this "month abbreviation" in code? -