[rt-users] Date/Time Output Format

Kevin Falcone falcone at bestpractical.com
Fri Aug 2 10:55:12 EDT 2013


On Thu, Aug 01, 2013 at 03:25:00PM -0700, Tim Gustafson wrote:
> How does one add an additional option to the drop-down for "Date
> format" under the "Locale" fieldset on individual user's "Settings"
> pages?
> 
> I'd like to add "mm/dd/yyyy hh:ii A" as an option - my users don't
> need/want seconds to be displayed there, but would like am/pm to show.
> 
> I looked at $DateTimeFormat but I don't see how that would enable me
> to let users still have the option of other formats.  All I want to do
> is add a new option, not take away the old ones.

Setting $DateTimeFormat controls the default your users get, there are
some examples of defining 'custom' ones, such as ISO without seconds,
or RFC2822 without seconds.  If there's an option already which is
'close' to what you want, you might be able to do that.

Otherwise, if you need something wholly custom, it's a pretty simple
plugin to add to the list, I've written one or two:

https://metacpan.org/module/RT::Extension::DateTAI64
you can see it's a tiny amount of perl code at the bottom of the file,
most of the text is documentation:
http://api.metacpan.org/source/FALCONE/RT-Extension-DateTAI64-0.01/lib/RT/Extension/DateTAI64.pm

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130802/8678ef79/attachment.sig>


More information about the rt-users mailing list