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

UndefinedBehaviorError: java.lang.ArrayIndexOutOfBoundsException: 0 #462

Open
faveoled opened this issue Jul 17, 2023 · 1 comment
Open

Comments

@faveoled
Copy link

faveoled commented Jul 17, 2023

import java.time.LocalDateTime
import java.time.format.DateTimeFormatterBuilder
import java.time.temporal.ChronoField
import java.time.format.TextStyle
import java.util.Locale
import java.time.format.DateTimeFormatter
import java.time.LocalDate
import java.time.ZoneId

val formatterFull: DateTimeFormatter = new DateTimeFormatterBuilder()
    .appendPattern("dd ")
    .appendText(ChronoField.MONTH_OF_YEAR, TextStyle.FULL_STANDALONE)
    .toFormatter(Locale.forLanguageTag("uk"))
val today = LocalDate.now(ZoneId.of("UTC"))
val todayString = today.format(formatterFull)
print(todayString)

This code works on JVM but fails with UndefinedBehaviorError on Scala.js

@cquiroz
Copy link
Owner

cquiroz commented Jul 21, 2023

I wonder if any of those variables is null, that would produce UndefinedBehavior I think

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