Firefox PHP

Module: Readable Dates and Concealed Times

Posted by Maurice Makaay 
Re: Module: Readable Dates
August 09, 2009 12:20AM
Is there a way to just have just "today" and "yesterday" display, but have everything else be the date? When I check "2 days", I get some that say "two days old", and if I do "1 day", it's just the "today" posts.

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Module: Readable Dates
August 09, 2009 12:39AM
I'm not sure I fully get what you're saying. I do get the requirement, but I don't see what you did with the 2 days and 1 day thing. If it's just some language string issues, then you could change mods/readable_dates/lang/english.php, but I'm not sure if that's what you're talking about here. Possibly a bug, but then I'd have to install the module here. I don't have it running currently.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Readable Dates
August 09, 2009 02:52AM
Sorry I wasn't more specific. With "2 day" and "1 day", I'm speaking of the module's settings. I use the following settings:

What granularity would you like to use? days

What is the time limit that you want to use for formatting? 2 days

I only want the readable date to go as far back as to say "yesterday", and to display the "today" dates for posts made that same day. For anything longer, like where it would say "two days ago" and farther, I just want it to display the regular date.

When choose 1 day, it only displays "today", and if I choose "2 days", it will display "yesterday" but it also displays "2 days ago" as well.

Sorry if I'm still not making sense, I'm not great with words.

Today (check)
Yesterday (check)
Two days ago (nu! Get outta here! *kicks*)

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Module: Readable Dates
August 09, 2009 02:10PM
I tried it, but I cannot reproduce it.
Do you see "2 days ago" for every 2 days old post or is this only showing for some of them?


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Readable Dates
August 09, 2009 11:18PM
It was showing for all of the two day old posts. I set it back to "2 day" (had it on "1 day" last night, so I wouldn't see the "two days old" listings while I worked). I went and searched for some two day old posts, and found some dated as early as August 07, 2009 02:07AM and as late as August 07, 2009 02:40PM. Odd thing is, it doesn't say "two day old" for them anymore, it just lists the date. If I set the option to "3 day" is when these change back to "two days old". It's strange, but I think the glitch reverted to normal. I have absolutely no idea how though. I didn't re-upload the module, and the settings for the mod are the same as they were a few days ago when the glitch was going on. I can now see just the "Yesterday" and "Today" statements, haven't found any "two day old" ones yet.

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Module: Readable Dates
August 10, 2009 12:59AM
I gave it another thought and this might have something to do with the fact that "not more than two days old" doesn't really mean "today and yesterday". "It means "posted within the last 48 hours". So if you post something at 01:00am, then there's 1 hour in today, 24 hours in yesterday and 23 hours in two days ago.

What this would require (not a bad change so I'll look into it) is that readable dates becomes day-away, so it will match the "x days ago" to what the user expects.

The reason that it is currently somewhat counter-intuitive, is that the "x days ago" was built up from "x seconds ago" -> "x minutes ago" -> "x hours ago". For those it makes sense to look at the time interval. For days and higher however, day/date awareness might be a better approach.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Readable Dates
August 26, 2009 02:18AM
Thanks for module.
here is a russian langfile attached

mmakaay: removed the attachment. The language file is now included in the package.



Edited 1 time(s). Last edit at 08/26/2009 07:38PM by Maurice Makaay.
Re: Module: Readable Dates
August 26, 2009 03:01AM
Russian language is much harder than english in case of numbers. If last digit of some number ends with 1 (101, 151, 100001, etc BUT not 11), we use one suffix fow "hour" word. If number ends with 2,3 or 4 (243, 784, etc) we use another suffix...
So Russian users should use my fix of date_format.php and my new version of lang file.
I believe that my fix to date_format.php shoudn't break numbering in English, but I'm not sure right now.

mmakaay: removed attachment; the required functionality has been included in the package.



Edited 2 time(s). Last edit at 08/26/2009 07:38PM by Maurice Makaay.
Re: Module: Readable Dates
August 26, 2009 03:12AM
I think that is a rather specific hack, since there are other languages for which some other combination would be required. What's wrong with doing this in the language file (except for "It wears out my C and V keys on the keybaord ;-) ?

    'seconds_ago_0'   => 'сейчас',
    'seconds_ago_1'   => 'секунду назад',
    'seconds_ago_2'   => '%count% секунды назад',
    'seconds_ago_3'   => '%count% секунды назад',
    'seconds_ago_4'   => '%count% секунды назад',
    'seconds_ago_x'   => '%count% секунд назад',


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Readable Dates
August 26, 2009 03:16AM
wrong is that we should write

'seconds_ago_2'   => '%count% секунды назад',
'seconds_ago_22'   => '%count% секунды назад',
'seconds_ago_32'   => '%count% секунды назад',
'seconds_ago_44   => '%count% секунды назад',

and so on.

it will be realy large lang file :)
And as far as I know, Spanish users will have the same situation

You are right, it's very specific hack :) so I don't recommend to use it for other languages, because it can cause mistakes



Edited 1 time(s). Last edit at 08/26/2009 03:19AM by sailord.
Sorry, only registered users may post in this forum.

Click here to login