refactor(horses-domain): replace kotlin.time.Clock with Clock in DomPferd
All checks were successful
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 6m51s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 6m46s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 6m36s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m55s
All checks were successful
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 6m51s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 6m46s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 6m36s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m55s
- Updated `getAge()` and `withUpdatedTimestamp()` to use `Clock.System` directly. - Simplifies imports and aligns with existing kotlinx.datetime standards. Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
parent
ceb1ccdab8
commit
e1514cfbce
|
|
@ -130,7 +130,7 @@ data class DomPferd(
|
||||||
*/
|
*/
|
||||||
fun getAge(): Int? {
|
fun getAge(): Int? {
|
||||||
return geburtsdatum?.let { birthDate ->
|
return geburtsdatum?.let { birthDate ->
|
||||||
val today = kotlin.time.Clock.System.todayIn(kotlinx.datetime.TimeZone.currentSystemDefault())
|
val today = Clock.System.todayIn(kotlinx.datetime.TimeZone.currentSystemDefault())
|
||||||
var age = today.year - birthDate.year
|
var age = today.year - birthDate.year
|
||||||
|
|
||||||
// Check if a birthday has occurred this year
|
// Check if a birthday has occurred this year
|
||||||
|
|
@ -169,6 +169,6 @@ data class DomPferd(
|
||||||
* Creates a copy of this horse with an updated timestamp.
|
* Creates a copy of this horse with an updated timestamp.
|
||||||
*/
|
*/
|
||||||
fun withUpdatedTimestamp(): DomPferd {
|
fun withUpdatedTimestamp(): DomPferd {
|
||||||
return this.copy(updatedAt = kotlin.time.Clock.System.now())
|
return this.copy(updatedAt = Clock.System.now())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user