01418: Please add ordinals to ftime{} markup expressions

Summary: Please add ordinals to ftime{} markup expressions
Created: 2017-08-19 07:58
Status: Open
Category: Feature
From: XES
Assigned:
Priority: 1
Version:
OS:

Description: Request simple additional markup for ftime{} per suggestion on the php strftime() page.

This will allow adding ordinals to date output for English output per the date() 'S' parameter.

Suggested code from comment on PHP documentation page:


function my_strftime ($format, $timestamp)
{
    $format = str_replace('%O', date('S', $timestamp), $format);    
    return strftime($format, $timestamp);
}

XES August 19, 2017, at 07:59 AM

While this is very easy to add, the "%O" format means something different in the library function strftime. We could use lowercase "%o" but what if some day PHP assigns this format to something else? --Petko August 19, 2017, at 08:20 AM

And unfortunately, PHP does not localize these, unlike the month and day names (though not a reason to not enable it, at least for English). --Petko August 19, 2017, at 08:32 AM

I think you'd want to use something that would be very unlikely to assigned as a strftime format, e.g. "%^". --simon August 27, 2017, at 07:31 PM

Not a problem -- I was just showing what the comment on the strftime() page showed. Absolutely not picky about the convention used. Not all websites require i8n, such as local websites for local events. But it's nice to be able to say an event will be on Wednesday the 8th of November. XES September 05, 2017, at 10:52 AM -- I believe in translations, the markup would be ignored.