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

Feature/auto upgrade joda #16

Open
wants to merge 14 commits into
base: 6.8
Choose a base branch
from
Open

Feature/auto upgrade joda #16

wants to merge 14 commits into from

Conversation

pgomulka
Copy link
Owner

@pgomulka pgomulka commented Jan 30, 2020

this is a PoC of auto migrating joda style patterns to java.time
It is basing on joda code responsible for parsing patterns, but instead of populating fields in DateFormatBuilder it appends translated letters into a new pattern.

This had to be a copy paste, as it required modifying (slightly though) methods that were private in joda.

if (i + 1 < length && pattern.charAt(i + 1) == '\'') {
// '' is treated as escaped '
i++;
buf.append(c);//THIS IS THE CHANGE COMPARED TO JODA
Copy link
Owner Author

@pgomulka pgomulka Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only change needed in joda's DateTimeFormat

import org.joda.time.format.DateTimeFormatterBuilder;
import org.joda.time.format.ISODateTimeFormat;

public class CustomDateTimeFormat {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy of required methods from DateTimeFormat (unable to extend)

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

Successfully merging this pull request may close these issues.

1 participant