Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to submit patches for elogv?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
pepoluan
n00b
n00b


Joined: 28 Feb 2011
Posts: 43
Location: Jakarta, Indonesia

PostPosted: Thu Nov 07, 2024 10:12 am    Post subject: How to submit patches for elogv? Reply with quote

I want to submit a patch for elogv that will add the option of specifying a different date format (currently it seems hard-coded to be "MM/DD/YY", and as a sane person I'd like it to be "YYYY-MM-DD" instead).

However, the elogv repo on GitHub ( https://github.com/gentoo/elogv ) seems to be just a mirror.

So, how do I submit a proposed patch to elogv?
_________________
Nobody is Perfect.
I am Nobody.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9607
Location: beyond the rim

PostPosted: Thu Nov 07, 2024 10:45 am    Post subject: Re: How to submit patches for elogv? Reply with quote

pepoluan wrote:
I want to submit a patch for elogv that will add the option of specifying a different date format (currently it seems hard-coded to be "MM/DD/YY", and as a sane person I'd like it to be "YYYY-MM-DD" instead).

However, the elogv repo on GitHub ( https://github.com/gentoo/elogv ) seems to be just a mirror.

So, how do I submit a proposed patch to elogv?


In doubt submit the patch to bugs.gentoo.org.
Back to top
View user's profile Send private message
nicop
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2014
Posts: 87

PostPosted: Thu Nov 07, 2024 10:59 am    Post subject: Reply with quote

Pull Request could be made :
https://github.com/gentoo/elogv/pulls
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1908

PostPosted: Thu Nov 07, 2024 1:49 pm    Post subject: Reply with quote

pepoluan wrote:
I want to submit a patch for elogv that will add the option of specifying a different date format (currently it seems hard-coded to be "MM/DD/YY", and as a sane person I'd like it to be "YYYY-MM-DD" instead).

It is actually using Python's %x modifier for locale specific date formatting with strftime. https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

This would have to be changed to isoformat (or another formatting string) to get the desired result.

Alternatively, there's a cheap workaround for ISO 8601 (YYYY-MM-DD) if you add en_DK.UTF-8 to /etc/locale.gen then run locale-gen:
Code:
LC_TIME=en_DK.UTF-8 elogv
This trick only works with %x strftime calls as other month names may not be what is expected.

Last edited by grknight on Thu Nov 07, 2024 3:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2397

PostPosted: Thu Nov 07, 2024 2:37 pm    Post subject: Re: How to submit patches for elogv? Reply with quote

pepoluan wrote:
as a sane person I'd like it to be "YYYY-MM-DD"


Don't mistake preference for sanity, because if it were, then for me you would be insane for not wanting it to be "DD/MM/YY".

Best Regards,
Georgi
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5084
Location: Bavaria

PostPosted: Thu Nov 07, 2024 2:47 pm    Post subject: Reply with quote

If you want to sort by date, YYYY-MM-DD is simply unbeatable ;-)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9607
Location: beyond the rim

PostPosted: Thu Nov 07, 2024 3:00 pm    Post subject: Re: How to submit patches for elogv? Reply with quote

logrusx wrote:
pepoluan wrote:
as a sane person I'd like it to be "YYYY-MM-DD"


Don't mistake preference for sanity, because if it were, then for me you would be insane for not wanting it to be "DD/MM/YY".

Well, he wants it to be something else than MM/DD/YY, that by definition makes him not insane. And DD/MM/YY has the issue that in many cases it can be mixed up with MM/DD/YY.

YYYY-MM-DD on the other hand is an international standard.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2397

PostPosted: Thu Nov 07, 2024 3:07 pm    Post subject: Reply with quote

pietinger wrote:
If you want to sort by date


I don't. I just want to make a point.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22610

PostPosted: Thu Nov 07, 2024 3:16 pm    Post subject: Reply with quote

MM/DD/YYYY is popular in the United States among lay people, but even there, programmers tend to prefer YYYY-MM-DD for the combination of unambiguous presentation (nobody has ever advocated YYYY-DD-MM, afaik, so seeing 4 digits in the first position can be assumed to be YYYY-MM-DD form) and natural sorting. That latter is pietinger's point: if one ever finds the need to sort by date, YYYY-MM-DD is optimal. In my experience, it is fairly common for people to want to sort by date, so people who are aware of date formatting tend to reach for this form as the first step. It's almost always easier to do that than to try to teach the sorting tool to carve out pieces of the date in the right order.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2397

PostPosted: Thu Nov 07, 2024 3:33 pm    Post subject: Reply with quote

My point is using other formats is not insane and I will end it here. The world is not only the US and dates are not only to be sorted, but also read by humans. In no way the date format is a sign of sanity.

Best Regards,
Georgi

p.s. I have no idea what there is to sort in elogv. Messages are already sorted in chronological order. Sorting point - irrelevant.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum