Skip to content

Commit

Permalink
fix: coerce null-valued date PRVs to null
Browse files Browse the repository at this point in the history
  • Loading branch information
superskip committed Feb 27, 2025
1 parent acf6eaf commit 18c3885
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {
mavenCentral()
}

version = "1.1.8-SNAPSHOT"
version = "1.1.9-SNAPSHOT"
group = "org.hisp.dhis.lib.expression"

if (project.hasProperty("removeSnapshotSuffix")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fun interface Typed {

fun toDateTypeCoercion(value: Any?): LocalDate? {
if (value == null) return null
if (value is VariableValue) return toDateTypeCoercion(toMixedTypeTypeCoercion(value))
if (value is VariableValue) return if (value.value == null) null else toDateTypeCoercion(toMixedTypeTypeCoercion(value))
if (value is LocalDate) return value
if (value is String) return LocalDate.parse(value)
if (value is Instant) return value.toLocalDateTime(TimeZone.currentSystemDefault()).date
Expand Down

0 comments on commit 18c3885

Please sign in to comment.