Skip to content

Incorrect parsing result #283

Description

@len-ny

There is problem to parse these 2 dates:

	void test() {

		List<String> samples = List.of(
				"17.09.2025; 15:15", 
				"09-April-24 05:01");

		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");

		for (String sample : samples) {
			List<Date> dates = new PrettyTimeParser().parse(sample);
			if (!dates.isEmpty()) {
				for (var date : dates) {
					System.out.println(sample + " → ✅ " + formatter.format(date));
				}
			} else {
				System.out.println(sample + " → ❌ Could not parse");
			}
		}
	}

The output:

17.09.2025; 15:15 → ✅ 2025-08-29T17:09
17.09.2025; 15:15 → ✅ 2025-08-29T15:15
natty line 1:3 no viable alternative at input 'April'
natty line 1:3 no viable alternative at input 'April'
natty line 1:3 no viable alternative at input 'April'
natty line 1:3 no viable alternative at input 'April'
09-April-24 05:01 → ✅ 2025-08-29T17:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions