Skip to content

Commit

Permalink
feat: use relative update time
Browse files Browse the repository at this point in the history
  • Loading branch information
fardavide committed Jan 12, 2024
1 parent 3a09557 commit fefb3f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public final class ConverterViewModel: ViewModel {
self.state.isLoading = false
self.state.error = nil
self.state.searchCurrencies = currencies
self.state.updatedAt = rates.updatedAt.formatted(date: .abbreviated, time: .shortened)
self.state.updatedAt = rates.updatedAt.formatted(.relative(presentation: .named))
self.state.values = favoriteCurrencies.currencyCodes.map { currencyCode in
currencyCode == baseCurrencyValue.currency.code
? baseCurrencyValue
Expand Down
4 changes: 2 additions & 2 deletions Core/Sources/Converter/Presentation/UI/ConverterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public struct ConverterView: View {
// Updated at text
if let updatedAt = state.updatedAt {
ToolbarItem(placement: .status) {
Text("Updated at: \(updatedAt)")
Text("Updated \(updatedAt)")
.font(.caption2)
}
}
Expand Down Expand Up @@ -157,7 +157,7 @@ private struct CurrencyValueRow: View {

#Preview("Success") {
Provider.setupPreview(viewModel: ConverterViewModel.samples.success)
return ConverterView()
return NavigationStack { ConverterView() }
}

#Preview("Network error") {
Expand Down
4 changes: 2 additions & 2 deletions Swiftly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0.9;
MARKETING_VERSION = 1.0.10;
PRODUCT_BUNDLE_IDENTIFIER = fardavide.Swiftly;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
Expand Down Expand Up @@ -647,7 +647,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0.9;
MARKETING_VERSION = 1.0.10;
PRODUCT_BUNDLE_IDENTIFIER = fardavide.Swiftly;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
Expand Down

0 comments on commit fefb3f7

Please sign in to comment.