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
Separate messages for the day before yesterday and the day after tomorrow #756
Comments
This is just for days, not for months, hours etc, right? @timrwood what do you think. We added a bunch of stuff just for strange looking Nepalese numbers, so adding a few lines in moment that calls the new format for 2 day diff makes sense to me. |
@ichernev, no-no, only for days) |
Google translate or some other online dictionary maybe. It guessed the day after tomorrow for Bulgarian, and for Estonian it picked a single word, that was different than the word for tomorrow, so I guess quite a few languages have specific words. I'm just thinking how good is it to use those words instead of the day of week, because their use is not that common and you have to think more to decipher it :) |
@ichernev, hm :-). Speaking about days of the week brings us to another issue I'd already opened one day: #573. |
@ichernev, I imagine it wouldn't be that hard to add in, but "The day before yesterday" seems a lot more verbose than "Sunday". If we do add it, I think it should only be for languages that have a specific word for two days from today and two days before today. On a side note, I know "last Sunday" is confusing, but what about "last week Sunday" instead? Rather than confusing the first sunday before now and the sunday of the week before today, we can just use the sunday of the week before today. Also, now that I think about it though, this method should probably be updated to use the localized start of week data. So in locales that start the week on Sunday, it would be "this week Sunday", and in locales that start the week on Monday it would be "last week Sunday"? |
@timrwood, I planned to render this as "Two days ago" :-). |
At least to me "last Saturday" means going back in time the first day that's Saturday. I'm not a native English speaker, so that might not apply for everybody. About the 2 days ago/from now -- I think it will be useful, only put it for languages that you're sure the phrase is used extensively (for Bulgarian I wouldn't suggest that). |
@ichernev, so if implementing this, should I override calendar function for some languages or...?) |
Just add an additional keys |
thanks @ichernev, will implement it) |
Sorry to reopen the discussion, but has this been somehow implemented in the meantime? 'moment.js' is running as part of the MagicMirror project and in the calendar module it's weird to see that for events that occur tomorrow it gives the German word for tomorrow and in the events that occur the day after tomorrow, it gives the German phrase for "in a day". Now, this is really confusing, because in German "in a day" and "tomorrow" are basically the same thing and the day after tomorrow would be "in two days". Ideally, instead of "in a day" it would give the German "übermorgen" (and also "vorgestern" for "the day before yesterday" but since the calendar module only shows events that are coming up, it doesn't really bother me at this stage 😄). I'm not familiar with the moment.js framework, but is there a quick fix I could code into my local files? |
I think this can be done by extending calendar. See #3175 |
Wow, you guys are fast! @maggiepint which calendar.js file would I be editing? The one in /src/lib/locale or the one in /src/lib/moment? Well, thanks to both of you. I have tried playing around with the moment.js package but I need to find out first how I can make any adjustments that filter through the node.js installation they're using because as of now, changing each and every translation in the 'de.js' file doesn't change anything on my screen. |
@yo-less you shouldn't need to edit anything in our source. Use the extensibility that I put in there to define moment.calendarFormat in your source code. Then override the 'de' locale with any additional options you need. |
@maggiepint Excellent, that's even nicer than I had anticipated, thanks. Will start experimenting with that. And, again, thanks for the great response time, you guys are awesome ^^ |
Creating this issue for discussion as suggested by @ichernev.
In many languages there are separate words for the day before yesterday and for the day after tomorrow:
So do we need this in Moment.js?
If the answer is "yes", I can code this out as well as modify corresponding languages and unit tests :).
The text was updated successfully, but these errors were encountered: