Skip to content

Commit

Permalink
fix: fixing am pm formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
daithihearn committed Jul 25, 2023
1 parent 7163c9c commit 764a9ce
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ bin/
.vscode/

# Deployment Script
deploy.sh
deploy.sh

.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ package ie.daithi.electricityprices.service

import org.slf4j.LoggerFactory
import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.annotation.Profile
import org.springframework.context.event.EventListener
import org.springframework.stereotype.Component
import java.util.concurrent.Executors
import java.util.concurrent.ThreadPoolExecutor

@Component
class PriceManager(private val priceService: PriceService, private val esiosSync: EsiosSync, private val reeSync: ReeSync) {
@Profile("prod")
class PriceManager(
private val esiosSync: EsiosSync,
private val reeSync: ReeSync
) {

private val logger = LoggerFactory.getLogger(this::class.java)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ val alexaSkillFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-M
val amPmFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("h a", esLocale)

fun formatAmPm(dateTime: LocalDateTime): String {
return amPmFormatter.format(dateTime).replace("a. m.", "AM")
.replace("p. m.", "PM")
return amPmFormatter.format(dateTime).replace("a.\u00A0m.", "AM")
.replace("p.\u00A0m.", "PM")
}
3 changes: 3 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ server:
ssl.trusted-certificates: /etc/ssl/cert.pem

spring:
profiles:
active:
${SPRING_PROFILES_ACTIVE:prod}
jackson.default-property-inclusion: non_null
mvc.pathmatch.matching-strategy: ant_path_matcher
data.mongodb.uri: ${MONGODB_URI:mongodb://localhost:27017/electricity-prices}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/i18n/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ alexa.tomorrow.rating.main.bad=Mañana es un día malo, con un precio promedio d
alexa.tomorrow.rating.main.normal=Mañana es un día normal, con un precio promedio de {0} centimos por kilovatio-hora. El mejor período de 3 horas comienza a las {1} con un precio promedio de {2} centimos. El peor período de 3 horas comienza a las {3} con un precio promedio de {4} centimos.
alexa.tomorrow.rating.main.no_data=Aún no hay datos disponibles para mañana. Por favor, vuelva más tarde. Los precios están generalmente disponibles a las 8:30 PM.
alexa.next.cheap.period.title=El próximo periodo bajo
alexa.next.cheap.period.main=El próximo periodo bajo empieza a las {0} horas con un precio medio de {1} centimos por kilovatio-hora.
alexa.next.cheap.period.main=El próximo periodo bajo empieza a las {0} con un precio medio de {1} centimos por kilovatio-hora.
alexa.next.cheap.period.main.no_data=Los periodos bajos de hoy ya han pasado.
alexa.current.cheap.period.title=El periodo barato actual
alexa.current.cheap.period.main=Actualmente se encuentra en el período de 3 horas más barato que comenzó a las {0} con un precio promedio de {1} centimos por kilovatio-hora.
Expand Down

0 comments on commit 764a9ce

Please sign in to comment.