! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
newlines in custom date are not rendered in calendar
Status:
RESOLVED: FIXED
Product:
Xfce4-datetime-plugin
Component:
General

Comments

Description Steve 2008-04-15 19:32:20 CEST
Newlines can be included in the custom date format of the datetime plugin.
These are rendered perfectly in the panel, but they appear as unknown characters in the date displayed at the bottom of the calendar.

Reproduce by configuring a custom date format like "%A%n%B %d%n%Y" which uses the "%n" format specification to insert a newline. Left click on the datetime plugin to display the calendar. Where the newlines are in the format, there are rectangles representing an unknown character.

A suggested solution is to allow users to specify a separate date format for the calendar rather than using the same format for both the panel and the calendar.

xfce4-datetime-plugin-0.5.0-3.fc8
Comment 1 Steve 2008-04-15 19:34:43 CEST
Created attachment 1589 
screenshot showing how newlines are rendered in datetime plugin
Comment 2 Diego Ongaro 2008-05-19 20:41:51 CEST
I'm the new maintainer for datetime, so I had Jannis re-assign this bug to me.

I think a simple way to fix this bug is to entirely get rid of the input field at the bottom of the popup:
 * Other than this newline problem, there's an issue if you don't have a year shown in your format string. For example, if you type in 05/18, it jumps to May 1, 0018.
 * Mike said that he likes to see the date shown there to see the month numerically (for example, 05 for May). He seemed content with the option of using the tooltip for that instead, though.

Any opinions on this matter are welcome, of course.
Comment 3 Steve 2008-05-19 21:46:51 CEST
(In reply to comment #2)
> I think a simple way to fix this bug is to entirely get rid of the input field
at the bottom of the popup

Removing it would be fine with me, having thought about it more since submitting this bug. It is redundant unless the popup displays the date in an alternative format.

> Other than this newline problem, there's an issue if you don't have a year
shown in your format string. For example, if you type in 05/18, it jumps to May
1, 0018.

I didn't realize that was an *input* field.  Interestingly, the "date" command works as expected for some ambiguous dates.
$ date -d 5/18
Sun May 18 00:00:00 PDT 2008
However:
$ date -d may
date: invalid date `may'

> Mike said that he likes to see the date shown there to see the month
numerically (for example, 05 for May). He seemed content with the option of
using the tooltip for that instead, though.

A tooltip is a good idea.  How will the format of the date it displays be configured?

A simple way to display the date in an alternative format is to install a *second* instance of the datetime plugin and configure it as needed.

Another way is to configure a custom date format that displays the date twice,
using a newline to separate them.
$ date +'%b %d, %Y%n(%F)'
May 19, 2008
(2008-05-19)

Perhaps there could be a "help" popup saying more about date/time formatting.

Thanks for picking this up.
Comment 4 Diego Ongaro 2008-05-19 21:52:45 CEST
(In reply to comment #3)

> A tooltip is a good idea.  How will the format of the date it displays be
configured?

Current versions of datetime (0.5 and trunk, IIRC) allow you to show "Time only, date in tooltip". Then you specify the date format as usual, but it ends up in your tooltip instead of on the panel.

> Perhaps there could be a "help" popup saying more about date/time formatting.

I think that's a good idea. I'll have to give it some thought.
Comment 5 Steve 2008-05-20 20:53:24 CEST
(In reply to comment #4)

> Current versions of datetime (0.5 and trunk, IIRC) allow you to show "Time
> only, date in tooltip". Then you specify the date format as usual, but it ends
> up in your tooltip instead of on the panel.

The tooltip functionality is in trunk, not 0.5.
(FYI, there is no 0.5 tag in the Xfce goodies repo.)

ISTM, that the tooltip could be displayed automatically when only the date or only the time is displayed in the panel, so there wouldn't need to be separate menu items explicitly enabling the tooltip. When both date and time are displayed in the panel, a tooltip would be redundant.

Trunk rev. 4832 is displaying the tooltip even when the layout is "Date only".

> > Perhaps there could be a "help" popup saying more about date/time formatting.
> 
> I think that's a good idea. I'll have to give it some thought.

Another way would be to provide a link to a page documenting the format.

AFAICT, there isn't anything as concise as the "date" man page.
http://www.gnu.org/software/coreutils/manual/coreutils.html#date-invocation
http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html


Comment 6 Diego Ongaro 2008-05-21 20:26:27 CEST
I removed the date input field in trunk (4835), so I'm closing this bug. I hope to not anger too many people this way...

Regarding "Trunk rev. 4832 is displaying the tooltip even when the layout is \"Date only\".", I believe I have fixed that in trunk (4834). If not, please open a dedicated bug report.

I also opened, based on the comments:
 * Bug 4098: tooltips by default in datetime
 * Bug 4099: format string help in datetime

Bug #4023

Reported by:
Steve
Reported on: 2008-04-15
Last modified on: 2010-11-09

People

Assignee:
Diego Ongaro
CC List:
2 users

Version

Version:
unspecified

Attachments

Additional information