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

DateTime format support in tooltips #421

Merged
merged 8 commits into from
Aug 18, 2021
Prev Previous commit
Next Next commit
Minor code cleanup.
  • Loading branch information
OLarionova-HORIS committed Aug 16, 2021
commit f04180f83d149e1cbcd891b868eaddcbcad464da
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class StringFormat private constructor(
) {
enum class FormatType {
NUMBER_FORMAT,
STRING_FORMAT,
DATETIME_FORMAT
DATETIME_FORMAT,
STRING_FORMAT
}

private val myFormatters: List<((Any) -> String)?>
private val myFormatters: List<((Any) -> String)>

init {
myFormatters = when (formatType) {
Expand Down Expand Up @@ -67,9 +67,9 @@ class StringFormat private constructor(
}
}

private fun initFormatter(formatPattern: String, formatType: FormatType): ((Any) -> String)? {
private fun initFormatter(formatPattern: String, formatType: FormatType): ((Any) -> String) {
if (formatPattern.isEmpty()) {
return null
return Any::toString
}
when (formatType) {
NUMBER_FORMAT -> {
Expand Down