Guess date dialog
walterxie opened this issue · 0 comments
walterxie commented
- It looks the Guess date dialog does not have the feature to deal with 2-digit year anymore, see the screenshot from BEAST 1:
- It seems the delimiter is restricted to 1 char, which does not allow the string, such as the screenshot below:
The code is in normalise in GuessPatternDialog. Not sure why not to use Java split()?
/**
* Converts the first character of delimiter into a substring suitable for
* inclusion in a regexp. This is done by expressing the character as an
* octal escape.
*
* @param delimiter first character of this string to be used as delimiter
* @return escaped octal representation of character
*/
private String normalise(String delimiter) {
if (delimiter.length() == 0) {
return ".";
}
return String.format("\\0%o", (int)delimiter.charAt(0));
}