-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support future dates as "from now" #67
Comments
That's something I've been meaning to add for a while. Hopefully will get around to do it soon. I do accept and appreciate Pull Requests too :) |
I can do the English part, but how do you deal with the localization? I have no idea how to translate "from now" :) |
You do the English part using resources like I've done for the past dates. I will take care of translations and buy you a beer if I meet you :) |
k, lemme see what I can do. I have a three hour flight tomorrow, so I'll fork, check into a branch and send you a PR when I can. |
So looking at the code, to promote code/string reuse, I would split the x days ago into three resources -- "x days", then "ago" and "from now". As to not break the other language translations, I'll create new resources for all, DateHumanize_SingleDay, DateHumanize_MultipleDays, etc. and then DateHumanize_Past and DateHumanize_Future (and perhaps a DateHumanize_Now). I'll have my code use those new ones and then the other language resources can be adapted. Does that make sense? |
I am a bit confused to be honest. Could you explain a bit more please? I haven't thought about this much; but I was thinking we could rename the existing resources to include a |
That could work, but I was going for reducing duplication of the single/multi combos multiplied by past/future. I was gonna just have a _SingleDay string, and then a _Past and a _Future. So the string format would look like this pseudo-code:
|
Ahhhh, gotcha. Thanks for explaining. That will work for English but it's going to make it rather difficult for localization. Redundancy in resources turned out to be the simplest solution to the localisation requirements of the library; so I'd say lets just add in new resources. I just realized that we don't actually need to rename the old resources (like I said above) for the dates in the past as resources already have an Thoughts? |
Okay, works for me. No need to deal with language craziness :) |
Implemented in #68 |
Looks like dates are all in the past.
How about future dates - should use the same breakdowns but be "from now" instead.
Also, maybe +/- some threshold, there could be a "now"
The text was updated successfully, but these errors were encountered: