Commit
This commit is contained in:
parent
89c648de3e
commit
ddceec8551
21
Schedule ICTIS/Assets.xcassets/arrowdown.imageset/Contents.json
vendored
Normal file
21
Schedule ICTIS/Assets.xcassets/arrowdown.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "arrow.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
Schedule ICTIS/Assets.xcassets/arrowdown.imageset/arrow.png
vendored
Normal file
BIN
Schedule ICTIS/Assets.xcassets/arrowdown.imageset/arrow.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 221 B |
21
Schedule ICTIS/Assets.xcassets/arrowup.imageset/Contents.json
vendored
Normal file
21
Schedule ICTIS/Assets.xcassets/arrowup.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "Vector.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
Schedule ICTIS/Assets.xcassets/arrowup.imageset/Vector.png
vendored
Normal file
BIN
Schedule ICTIS/Assets.xcassets/arrowup.imageset/Vector.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 222 B |
@ -38,14 +38,17 @@ extension Date {
|
||||
|
||||
var week: [WeekDay] = []
|
||||
let weekForDate = calendar.dateInterval(of: .weekOfMonth, for: startOfDate)
|
||||
//print("Start: \(weekForDate?.start)")
|
||||
//print("End: \(weekForDate?.end)")
|
||||
|
||||
guard let startOfWeek = weekForDate?.start else {
|
||||
return []
|
||||
}
|
||||
|
||||
// Создаем дни для недели
|
||||
(0..<7).forEach { index in
|
||||
if let weekDay = calendar.date(byAdding: .day, value: index, to: startOfWeek) {
|
||||
week.append(.init(date: weekDay))
|
||||
week.append(WeekDay(date: weekDay))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,8 @@ struct ScheduleView: View {
|
||||
@State private var weekSlider: [[Date.WeekDay]] = []
|
||||
@State private var currentWeekIndex: Int = 1
|
||||
@State private var createWeek: Bool = false
|
||||
@ObservedObject var vm = ViewModel()
|
||||
@State private var isShowingMonthSlider: Bool = false
|
||||
@StateObject var vm = ViewModel()
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
@ -107,6 +108,16 @@ struct ScheduleView: View {
|
||||
Text(currentDate.format("MMMM"))
|
||||
.font(.system(size: 20, weight: .bold))
|
||||
.foregroundStyle(Color("grayForDate"))
|
||||
Spacer()
|
||||
HStack (spacing: 2) {
|
||||
Text(isShowingMonthSlider ? "Свернуть" : "Развернуть")
|
||||
.font(.system(size: 15, weight: .light))
|
||||
.foregroundStyle(Color.blue)
|
||||
Image(isShowingMonthSlider ? "arrowup" : "arrowdown")
|
||||
}
|
||||
.onTapGesture {
|
||||
isShowingMonthSlider.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.top, 8)
|
||||
|
Loading…
x
Reference in New Issue
Block a user