Skip to content
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

Prettytime.formatUnrounded giving - with russian string #182

Closed
B0pol opened this issue Feb 15, 2020 · 3 comments
Closed

Prettytime.formatUnrounded giving - with russian string #182

B0pol opened this issue Feb 15, 2020 · 3 comments

Comments

@B0pol
Copy link
Contributor

B0pol commented Feb 15, 2020

You can see the date of the videos at the rigth. The screenshot is from NewPipe, using Prettytime.formatUnrounded(Calendar then) function.

You can reproduce it with by adding this in PrettyTimeI18n_RU_Test.java

@Test
public void testCalculatePreciseDuration2() {
    PrettyTime prettyTime = new PrettyTime();
    prettyTime.clearUnits();
    Minute minutoj = new Minute();
    prettyTime.registerUnit(minutoj, new ResourcesTimeFormat(minutoj));
    Assert.assertEquals("40 minutes ago",prettyTime.formatUnrounded(
      prettyTime.calculatePreciseDuration(new Date(new Date().getTime() - 40 * 60 * 1000 - 40 * 1000))));
}

Output:

org.junit.ComparisonFailure: 
Expected :40 minutes ago
Actual   :-40 минут назад

As you can see, there is that -

@lincolnthree
Copy link
Member

Hi, thanks for submitting this issue.

Apologies for the delay in responding. I haven't had a chance to evaluate your test case yet (thanks for attaching a reproduction). I will try to get to it soon, but if you find the root cause before then, pull requests are very welcome!

Thanks and sorry again for the wait,
~Lincoln

@sryze
Copy link
Contributor

sryze commented May 18, 2020

Hello, I opened a pull request to fix this issue in NewPipe, please take a look: #189

lincolnthree added a commit that referenced this issue Jun 4, 2020
Fix negative duration in Russian version (#182)
@B0pol
Copy link
Contributor Author

B0pol commented Jun 25, 2020

Fixed by #189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants