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

SimpleDateFormat.format - NotImplementedError - escaping text fragment with single quotes #216

Open
Sciss opened this issue Oct 31, 2020 · 2 comments

Comments

@Sciss
Copy link

Sciss commented Oct 31, 2020

import java.util.Locale
val fmt = new java.text.SimpleDateFormat("[d MMM yyyy, HH:mm''ss.SSS] 'AudioFile' ", Locale.US)
fmt.format(new java.util.Date)

This throws NotImplementedError (???). Goes away when I remove the escaped fragment 'AudioFile'.

The JDK docs are clear:

Text can be quoted using single quotes (') to avoid interpretation.

@Sciss Sciss changed the title NotImplementedError - escaping text fra NotImplementedError - escaping text fragment with single quotes Oct 31, 2020
@Sciss Sciss changed the title NotImplementedError - escaping text fragment with single quotes SimpleDateFormat.format - NotImplementedError - escaping text fragment with single quotes Oct 31, 2020
@Sciss
Copy link
Author

Sciss commented Oct 31, 2020

Also this rule is not followed:

"''" represents a single quote

instead they are presented as two single quotes.

@cquiroz
Copy link
Owner

cquiroz commented Oct 31, 2020

Hi, this implementation of SimpleDateFormat is not really for production use, it is only a minimal set of stubs to make DateTimeFormatter work on scala-java-time.
I'd discourage its direct use

Improvements are welcome of course if you want to fix its shortcomings

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