xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.78k stars 1.33k forks source link

TimeRow Not Using Correct TimeZone #2259

Open RSady opened 4 months ago

RSady commented 4 months ago

I'm creating two separate rows...a TimeRow and a ButtonRow. On the button tap I set the TimeRow value to Date(). The date displays but it's always one hour behind my current time zone. I'm in EST, and it's formatting to be displayed in CST. I've checked the actual Date() value and it's correct.

<<< TimeRow(CellTags.time, { row in
    row.title = "Time"
})

<<< ButtonRow(CellTags.timeButton, { row in
    row.title = "Set Time to Now + 2 Min"
}).onCellSelection({ [weak self] cell, row in
    guard let self else { return }
    (form.rowBy(tag: CellTags.time) as? TimeRow)?.value = Date()
    (form.rowBy(tag: CellTags.time) as? TimeRow)?.updateCell()
})

When printing the time out, in the .onChange() in the TimeRow, I see this... Optional(2024-07-19 21:46:07 +0000)

Am I missing something here? I've tried setting the cells default dateFormatters timeZone and Locale and nothing changes.

Simulator Screenshot - iPhone 15 Pro Max - 2024-07-19 at 17 47 15