Bug 6884 - Add a value to shortDateFormats
: Add a value to shortDateFormats
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Plugin
: 7.4.1
: All All
: P3 normal (vote)
: 7.4.x
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-31 09:50 UTC by Kyle K.
Modified: 2009-11-26 23:41 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments
proper strftime formatting (maybe) (562 bytes, patch)
2009-11-03 12:32 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle K. 2008-01-31 09:50:20 UTC
I personally prefer the following shortDateFormat when viewing dates:

q(%a %-m/%d) => q{WWW M/DD}

Any chance of this being added to the default Utils/DateTime.pm? I currently have to put it in after every upgrade. :(
Comment 1 Michael Herger 2008-01-31 13:41:01 UTC
Hey, where do you get to see the short date at all? Can't test, as I don't find any...
Comment 2 Kyle K. 2008-02-01 04:52:37 UTC
The WeatherTime (http://code.google.com/p/weathertime/ ) plugin uses it by default.
Comment 3 Michael Herger 2008-02-01 05:47:22 UTC
Should this have been:
q(%a %m/%d) => q{WWW M/DD}
        ^^^^^
Comment 4 Kyle K. 2008-02-01 09:17:35 UTC
No, the dash (-) makes it print only a single digit instead of zero padded two digits for Jan. - Sep.
Comment 5 Blackketter Dean 2008-02-01 13:07:04 UTC
Let's make this change in trunk for 7.0.1
Comment 6 Michael Herger 2008-03-07 17:33:21 UTC
Punting enhancements post 7.0.x series
Comment 7 Michael Herger 2008-04-22 07:32:06 UTC
change 19033 - please test and re-open if needed, thanks!
Comment 8 Chris Owens 2008-07-30 15:30:32 UTC
This bug has now been fixed in the 7.1 release version of SqueezeCenter!  Please download the new version from http://www.slimdevices.com if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 9 Chris Owens 2009-07-31 10:16:36 UTC
Reduce number of active targets for SC
Comment 10 KDF 2009-11-03 12:13:30 UTC
This change seems to have caused a bug:
http://forums.slimdevices.com/showthread.php?t=70904

I can confirm the problem, and doing as Michael suggested seems to fix it.  We are, however, in a double-digit month so haven't tested single digit yet.  Cleary the regex isn't quite right.
Comment 11 KDF 2009-11-03 12:32:48 UTC
Created attachment 6264 [details]
proper strftime formatting (maybe)

This seems to the be correct version for POSIX strftime in perl, at least on windows - so this site suggests: 
http://codingforums.com/showthread.php?t=73769
Comment 12 Michael Herger 2009-11-19 08:42:56 UTC
(In reply to comment #4)
> No, the dash (-) makes it print only a single digit instead of zero padded two
> digits for Jan. - Sep.

Where did you find that information? Can't get this to work, neither using your format string nor kdf's alternate change (using #).
Comment 13 Kyle K. 2009-11-19 08:55:08 UTC
(In reply to comment #12)
> (In reply to comment #4)
> > No, the dash (-) makes it print only a single digit instead of zero padded two
> > digits for Jan. - Sep.
> 
> Where did you find that information? Can't get this to work, neither using your
> format string nor kdf's alternate change (using #).

From the man page on my Fedora box:

   Glibc Notes
       Glibc provides some  extensions  for  conversion  specifications.   (These  extensions  are  not  specified  in
       POSIX.1-2001,  but a few other systems provide similar features.)  Between the '%' character and the conversion
       specifier character, an optional flag and field width may be specified.  (These precede the E or  O  modifiers,
       if present.)

       The following flag characters are permitted:

       _      (underscore) Pad a numeric result string with spaces.

       -      (dash) Do not pad a numeric result string.

       0      Pad  a numeric result string with zeros even if the conversion specifier character uses space-padding by
              default.

       ^      Convert alphabetic characters in result string to upper case.

       #      Swap the case of the result string.  (This flag only works with certain conversion specifier characters,
              and of these, it is only really useful with %Z.)

       An optional decimal width specifier may follow the (possibly absent) flag.  If the natural size of the field is
       smaller than this width, then the result string is padded (on the left) to the specified width.
Comment 14 Michael Herger 2009-11-19 09:08:56 UTC
>    Glibc Notes
>        Glibc provides some  extensions  for  conversion  specifications.

I've been testing on OSX - I doubt there are these Glibc extensions. Which  
means: if this is limited to systems using Glibc we'll have to live  
without the removal of the leading zero.
Comment 15 KDF 2009-11-19 09:25:55 UTC
my patch, as noted ONLY works in windows.  The fix that I did is only valid for windows version of strftime.  The problem is that the strict ansi standard doesn't have the option for single-digit.  Other platforms have it, but it's not standardised. I never found a true cross-platform option, and agree it's probably a lot of headache to try to add this small thing to the OS-dependant modules.
Comment 16 SVN Bot 2009-11-26 23:41:40 UTC
 == Auto-comment from SVN commit #29494 to the slim repo by michael ==
 == https://svn.slimdevices.com/slim?view=revision&revision=29494 ==

Fixed Bug: 6884
Description: fix the short date format. We're using our custom method stripping leading zeros (using |) to overcome platform limitations