Skip to content

Commit

Permalink
add UI for bill date
Browse files Browse the repository at this point in the history
  • Loading branch information
luxterful committed Mar 7, 2023
1 parent ab3f349 commit 0c8d996
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PayForMe/Views/BillDetail/BillDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ struct BillDetailView: View {
TextField("What was paid", text: self.$viewModel.topic)
TextField("How much", text: self.$viewModel.amount).keyboardType(.decimalPad)
}
Section(header: Text("Date")) {
DatePicker(selection: self.$viewModel.billDate) {
Label("Bill date", systemImage: "calendar").labelStyle(.iconOnly)
}
}
Section(header: Text("Owers")) {
PotentialOwersView(vm: viewModel.povm)
}
Expand Down
4 changes: 4 additions & 0 deletions PayForMe/Views/BillDetail/BillDetailViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class BillDetailViewModel: ObservableObject {

@Published
var currentBill: Bill

@Published
var billDate: Date = Date()

var povm: PotentialOwersViewModel

Expand Down Expand Up @@ -81,5 +84,6 @@ class BillDetailViewModel: ObservableObject {
povm.isOwing[index] = true
}
}
billDate = currentBill.date
}
}

0 comments on commit 0c8d996

Please sign in to comment.