ocpsoft / prettytime

Social Style Date and Time Formatting for Java
http://ocpsoft.org/prettytime/
Apache License 2.0
1.29k stars 252 forks source link

pass reference to parse function #238

Closed michaelrolnik closed 1 year ago

michaelrolnik commented 1 year ago

PrettyTimeParser.parse function should look like this

   {
      language = words2numbers(language);

      List<Date> result = new ArrayList<Date>();
      List<com.joestelmach.natty.DateGroup> groups = parser.parse(language, now);
      for (com.joestelmach.natty.DateGroup group : groups) {
         result.addAll(group.getDates());
      }
      return result;
   }

otherwise it always assumes the current date which in many contexts is incorrect.

please fix

lincolnthree commented 1 year ago

Hey @michaelrolnik - I believe this PR fixes the issue, can you confirm? I'm working on putting out a new release with this change.

michaelrolnik commented 1 year ago

Hi Lincoln Baxter, III

I think it does. Thanks

On Thu, Sep 1, 2022 at 7:30 PM Lincoln Baxter, III @.***> wrote:

Hey @michaelrolnik https://github.com/michaelrolnik - I believe this PR fixes the issue, can you confirm? I'm working on putting out a new release with this change:

236 https://github.com/ocpsoft/prettytime/pull/236

— Reply to this email directly, view it on GitHub https://github.com/ocpsoft/prettytime/issues/238#issuecomment-1234514646, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQ4VISLUQVDUOSXO2B3GPTV4DKY7ANCNFSM6AAAAAAQBM5XX4 . You are receiving this because you were mentioned.Message ID: @.***>

-- Best Regards, Michael Rolnik

lincolnthree commented 1 year ago

Awesome. The new version should be available in Maven Central now: https://mvnrepository.com/artifact/org.ocpsoft.prettytime/prettytime/5.0.4.Final

Thanks again!