Комментарии:
I have a problem that when I print my selected `Current Date` to the console (let's say I select February 8), the console gives an output date of February 7. is there a solution regarding this?
ОтветитьLove it, is amazing, please build in other video an custom view neomorphist
ОтветитьIt crashes when showing Januray 2023, because of index out of range in func extractDate()
Solution:
[...]
var firstWeekday = calendar.component(.weekday, from: days.first?.date ?? Date())
if firstWeekday == 1 {
firstWeekday = 8 // Sunday is represented by 1, so we set it to 8 to make it the last day of the week
}
for _ in 0..<firstWeekday - 2 {
days.insert(DateValue(day: -1, date: Date()), at: 0)
}
[...]
Hope this helps!
awesome
ОтветитьGreat idea for elegant calendar and some really good pointers for SwiftUI coders. Minor issues: "Remainder' should be 'Reminder' obviously and the current date should only be highlighted if user is in current month. As others have noted, Locale() date could determine day labels, week start date etc. Thanks for an awesome video.
ОтветитьI have all of the same code as you but for some reason I can't use Calendar.current
ОтветитьI noticed that the "Add Task" and "Add Reminder" buttons don't have any actions assigned to them so they don't do anything. Anyone have the code to complete the Date Picker
ОтветитьHow can I change the code so the weekdays start on Mon?
ОтветитьHello Balaji!
My name is Gleb and I want to thank you for sharing your knowledge. You make videos that are simple and easy to follow.
I started with zero knowledge of Swift, but by watching your tutorials I managed to learn a lot and build an app for my brother in three months. He is happy and so am I. The app is built on the basis of your custom date picker and other features that you show in your tutorials. Thanks again and keep posting!
Kavsoft, the SwiftUI goat
ОтветитьHello, how would I replace the offset value to something that would be set to specific dates? for example the reminder event "football with harry" is set on the 25th march, rather than having an offset of 2 (2days from the current date) ? as this date constantly moves as the current date moves. Any help here would be appreciated! Thanks
Ответитьin extraDate(), change the `let date` part to `let date = formatter.string(from: getCurrentMonth())`, instead of `from: currentDate`. If you use currentDate here, onChange, your binding var will change to which ever month the user navigates to, and whichever day the user clicks.
ОтветитьI built this and I'm having buildtime issues. I corrected my code but I have 3 issues left in the Swift files to finish the app. Do you have a email so I can screenshot the issue and send you the code. I followed along with tutorial and would like to get this aspect of the app finished.
It has to do with the CustomDatePicker and the Home page.
With the CustomDatePicker,
It says the 'extension Date' declaration is only valid at file scope.
& 'HStack in the DayView' has error code Type () cannot conform to View
With Home.swift it says the VStack containing the CustomDatePicker has error code Generic parameter 'Content' could not be inferred.
Looking forward to your reply.
Thanks for inspiring my app 😍😍😍
ОтветитьHow to set Monday for first of week? Please answer!!!
ОтветитьLove it! Did the whole walkthough. Maybe in the future if there were an explanation on what calendar is and such would be handy! None the less I think this is great!
ОтветитьGreat job, man!
ОтветитьAmazing
Ответитьхорошая работа.
ОтветитьThank you) You are good at it! Great calendar! Tell me how to make the calendar scroll a month ahead or a month back without using the buttons above. Ie to scroll with your hands to the left or to the right)
Ответить