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

Not showing "month ago" when February #99

Closed
magx2 opened this issue Mar 3, 2015 · 4 comments
Closed

Not showing "month ago" when February #99

magx2 opened this issue Mar 3, 2015 · 4 comments

Comments

@magx2
Copy link

magx2 commented Mar 3, 2015

Let's say today’s date is 1 March 2015 and I want to format 1 February 2015. Instead of getting month ago I get 28 days ago.

@lincolnthree
Copy link
Member

Hmmm, this sounds like an issue with rounding tolerance. Could you provide a test case that reproduces this issue?

@magx2
Copy link
Author

magx2 commented Mar 7, 2015

Ok, at Monday I will send smt to you.

@lincolnthree
Copy link
Member

Thank you!

@magx2
Copy link
Author

magx2 commented Mar 18, 2015

Sorry for the delay. In our project we are using ours units and this is the problem (I tested it without our units and it worked fine).

I'm closing issue because bug is not in the library.

BTW. could you look at my code and say where I have mistake:

        private static final PrettyTime prettyTime = new PrettyTime(PL);

        [...]

        static {
                prettyTime.clearUnits();

                JustNow justNow = new JustNow();
                justNow.setMaxQuantity(1000L * 60L * 60L);
                prettyTime.registerUnit(justNow, new ResourcesTimeFormat(justNow));

                Hour hour = new Hour();
                prettyTime.registerUnit(hour, new HourTimeFormat(hour));

                Day day = new Day();
                prettyTime.registerUnit(day, new ResourcesTimeFormat(day));

                Month month = new Month();
                prettyTime.registerUnit(month, new MonthTimeFormat(month));

                Year year = new Year();
                prettyTime.registerUnit(year, new YearTimeFormat(year));
        }```

@magx2 magx2 closed this as completed Mar 18, 2015
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

2 participants