[Users] FYI: Bad date formats and sorting...

wwp subscript at free.fr
Wed Jun 1 08:46:11 CEST 2016


Hello H.Merijn,


On Wed, 1 Jun 2016 08:01:42 +0200 "H.Merijn Brand" <h.m.brand at xs4all.nl> wrote:

> On Wed, 1 Jun 2016 07:42:49 +0200, Andrej Kacian <andrej at kacian.sk>
> wrote:
> 
> > On Tue, 31 May 2016 19:26:24 -0400
> > Pierre Fortin <pf at pfortin.com> wrote:
> >   
> > > Yup...  looked into the code and thought the best place to "fix" this
> > > was as the message(s) arrived...  I'm willing to give it a shot if someone
> > > can point me to the right bit of code (inc.c?) where the message arrives
> > > and just before it gets written, I can give it a try...      
> > 
> > We generally have a policy of not modifying contents of received
> > messages, so instead of fixing the date, I think it would be better to
> > just parse the obsolete date string correctly. Look in procheader.c,
> > function procheader_scan_date_string().
> > 
> > Regards,  
> 
> I always add code there too, because I cannot stand AM/PM
> 
> @@ -820,6 +820,18 @@ static gint procheader_scan_date_string(const gchar *str,
>  			day, month, year, hh, mm, ss);
>  	if (result == 6) return 0;
>  
> +	result = sscanf(str, "%3s %3s %d %2d:%2d:%2d %d",
> +			weekday, month, day, hh, mm, ss, year);
> +	if (result == 7) return 0;
> +
> +	result = sscanf(str, "%3s, %d %3s %d %2d:%2d:%2d %2s",
> +			weekday, day, month, year, hh, mm, ss, zone);
> +	if (result == 7) {
> +	    if (*zone == 'P') hh = hh + 12;
> +	    *zone = (gchar)0;
> +	    return 0;
> +	    }
> +
>  	*ss = 0;
>  	result = sscanf(str, "%10s %d %9s %d %2d:%2d %6s",
>  			weekday, day, month, year, hh, mm, zone);

Where in the GUI/data do you have to act from the code in order to
customize date/time display that you cannot do from the preferences?
Could you please elaborate a bit?


Regards,

-- 
wwp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20160601/53f885f7/attachment.sig>


More information about the Users mailing list