Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom/locale-based date format #1767

Closed
mc-butler opened this issue Oct 31, 2009 · 15 comments
Closed

Custom/locale-based date format #1767

mc-butler opened this issue Oct 31, 2009 · 15 comments
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around ver: 4.7.0-pre4 Reproducible in version 4.7.0-pre4
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/1767
Reporter gotar (gotar@….pl)

MTime in panels since always is displayed as:

MMM dD YYYY
MMM dD hh:mm

where:

MMM=abmon
dD=day of month (1 or 2 digits)
YYYY=year
hh:mm=time (24h clock)

This leads to several issues:

  1. obviously MDY order us english-centrific - and illogical, as we don't give e.g. time in hours-seconds-minutes order. For example in polish (language grammar) the only official order is DMY, and YMD is allowed for computer systems (as international ISO-8601 format). Of course having dD MMM hh:mm (when displaying newer files in which case YYYY is replaced with time) would be not so illogical too.
  1. not all languages even have their own official abmons and abdays (like polish). Just take a look at:

http://sourceware.org/bugzilla/show_bug.cgi?id=3156
http://sourceware.org/bugzilla/show_bug.cgi?id=4789
https://bugzilla.redhat.com/show_bug.cgi?id=242296

so current glibc abmons are allowed but not official.

2a. even if abmons are defined, it's bad assumption that they have the same length. For example when glibc team had changed polish to roman numbers (I, II, ... VIII...) there were problems like mentioned here:

https://bugzilla.redhat.com/show_bug.cgi?id=243513

Fortunately this change was eventually reverted and so now we have:

$ LC_TIME=pl_PL locale -k d_fmt abmon t_fmt abday d_t_fmt
d_fmt="%d.%m.%Y"
abmon="sty;lut;mar;kwi;maj;cze;lip;sie;wrz;paź;lis;gru"
t_fmt="%T"
abday="nie;pon;wto;śro;czw;pią;sob"
d_t_fmt="%a, %-d %b %Y, %T"

I think date and time format should be configurable directly by strftime format string with an option to simply follow d_t_fmt. Length of such string could be calculated cycling through all format elements or explicitly given.

@mc-butler
Copy link
Author

Changed by bilbo (@bilbo2) on Nov 2, 2009 at 1:29 UTC (comment 1)

  • Severity changed from no branch to on rework
  • Owner set to bilbo
  • Status changed from new to accepted

MC use two timeformats - for files with mtime between now and "6 moths old" (like "Nov 2 00:56") and for other files (like "Jun 23 2007")

I think it could be useful to have custom time format in settings for both of these cases - if you want to have same timeformat regardless of file age, you can set both formats to same value.

Then you could be able to set your own timeformat

Created branch 1767_custom_date_format
Initial commit [8716e92640fc29e86e1e27ee4657426c144d976a]

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Nov 2, 2009 at 2:13 UTC (comment 2)

I referred to these two timeformats as 'date' and 'time' - but yes, that's exactly what I have on my mind:) Thnx!

@mc-butler
Copy link
Author

Changed by bilbo (@bilbo2) on Nov 2, 2009 at 13:12 UTC (comment 3)

  • Severity changed from on rework to on review

The patch is in branch 1767_custom_date_format

The timeformat can be configured in ~/.mc/ini in Misc section, using strftime format, like for example the format I am now personally using:

[Misc]
timeformat_recent=%d.%m.%y %H:%M
timeformat_old=%d.%m.%y %H:%M

There is no way (yet) to configure it inside MC, but I guess that would be solved in future by implementing #1516

@mc-butler
Copy link
Author

Changed by styx (@styx) on Nov 5, 2009 at 5:57 UTC (comment 4)

Not setting to rework, but nothing happens to me when setting (or any thing other):

[Misc]
timeformat_recent=%d.%m.%y %H:%M
timeformat_old=%d.%m.%y %H:%M

@mc-butler
Copy link
Author

Changed by bilbo (@bilbo2) on Nov 9, 2009 at 0:42 UTC (comment 5)

This is weird, for me it works.

Also, there is already a [Misc] section in the ~/.mc/ini by default, so if there is, you probably need to add just the two lines there, I am not sure how config system will handle two [Misc] sections in the ini file.

If it still is not working - can you post here your entire .mc/ini?

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Nov 25, 2009 at 11:14 UTC (comment 6)

Branch rebased and reworked:

  • [fc5e9ff28f941c402c5914efdae6f2a8e2e3a9cd]: Custom/locale-based date format

In commit I was add freezing of timeformat variables.

Review, please.

Martin: for update your local branch use commands:

git checkout 1767_custom_date_format
git fetch origin
git reset --hard origin/1767_custom_date_format

@mc-butler
Copy link
Author

Changed by metux (@metux) on Dec 26, 2009 at 22:31 UTC (comment 7)

  • Votes set to metux

remember rebasing before merge ;-p

@mc-butler
Copy link
Author

Changed by metux (@metux) on Dec 26, 2009 at 22:36 UTC (comment 8)

  • Blocked by set to #1872

Didnt pass buildfarm test (see #1872)

@mc-butler
Copy link
Author

Changed by styx (@styx) on Jan 26, 2010 at 13:36 UTC (comment 9)

  • Type changed from defect to enhancement

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Feb 4, 2010 at 9:35 UTC (comment 10)

  • Blocked by #1872 deleted

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Feb 9, 2010 at 14:10 UTC (comment 11)

Branch rebased.

New initial changeset: [83a7b337db7f62f60b96bed1f7587af10010f12f]

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Feb 12, 2010 at 13:47 UTC (comment 12)

  • Votes changed from metux to metux angel_il

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Feb 15, 2010 at 10:23 UTC (comment 13)

  • Severity changed from on review to approved
  • Votes changed from metux angel_il to metux angel_il slavazanko

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Feb 15, 2010 at 10:26 UTC (comment 14)

  • Status changed from accepted to testing
  • Milestone changed from 4.7 to 4.7.1
  • Severity changed from approved to merged
  • Votes changed from metux angel_il slavazanko to commited-master
  • Resolution set to fixed

merge [533edd0]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Feb 15, 2010 at 10:28 UTC (comment 15)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around ver: 4.7.0-pre4 Reproducible in version 4.7.0-pre4
Development

No branches or pull requests

1 participant