Flexible FriendlyTime v1.4

Release Notes

Cleaned up the translation code

Changed format of changelog to work in plugins page

  • It only affects times output by the elgg friendly timei view - I don't know if event calendar is using that or not.

    Currently the plugin only outputs time globally - ie. if you set an offset it's the same offset for everyone regardless of location.  It's possible to update it to use viewer timezone settings.

  • For events specifically the best thing to do would be to contact Kevin Jardine and see how much he'd charge to add in user timezone handling.

  • straight hard code =>
    date('j M Y',..)
    no settings, nothing;
    for events ->  it has to be the event's date that (really) matters,
    we could do something like (free) timeanddate.com does
    in their 'meeting planner'  and maybe (at least) display zones
    (e.g. from my little js 'world clock';) to let users pick/choose
    and coordinate their timezones w.r.t meetings or events ->

    RIC Jan 9 2013
    20 01 28
    STG
    Jan 9 2013
    21 01 28
    SYD
    Jan 10 2013
    12:01 28    DST  
    GMT
    Jan 10 2013
    1 01 28
    SFO
    Jan 9 2013
    17 01 28
    CHI
    Jan 9 2013
    19 01 28
    AMS
    Jan 10 2013
    2 01 28
    PAR
    Jan 10 2013
    2 01 28
    DEL
    Jan 10 2013
    6 31 28
    HKG
    Jan 10 2013
    9 01 28
  • Thanks for this very useful mod.

    With ref. to this discussion,

    I see I can change/translate the name of months but how do I do so for the digits - 0 to 9 ?

    For example, 16  -> १६

    or 1 -> १

    Any translations for 'just now', minutes, hours, 'ago' etc?

    Can someone explain in some more details?

  • You'll have to override the view and translate them there.  I don't think people usually think about translating numbers, I sure don't.

  • If it's a simple 1:1 character replacement (eg. 1 = a, 2 = b, so 12 = ab) you can hook into the views and replace each character after they render.  This would be the preferred way so you can target multiple views and not have to be concerned with overrides.  I don't know any other languages though so I'm no use to anybody when it comes to the finer details of parsing for programmatic translation.  Simple string and character substitution is as much as I can tell you.

  • Thanks Matt. Thanks again. Yes, simple str replace works fine. I am not sure if it can break anything else or cause any other problem but it does work okay for me.

Matt Beckett

I'm a self-employed web developer, family man, nerd, scuba diver. Manager/maintainer of this elgg community site, and core Elgg development team member.

Stats

  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2015-10-13
  • Downloads: 2045
  • Recommendations: 11

Other Projects

View Matt Beckett's plugins