Created
July 3, 2024 07:39
-
-
Save velotiotech/fa11a23fed4343783ec875bd011f531d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MonthlyHolidayWidget_Previews: PreviewProvider { | |
static var previews: some View { | |
// Provide a preview of the MonthlyHolidayWidgetEntryView for the widget gallery | |
MonthlyHolidayWidgetEntryView(entry: DayEntry(date: dateToDisplay(month: 12, day: 22), configuration: ConfigurationIntent())) | |
.previewContext(WidgetPreviewContext(family: .systemLarge)) | |
} | |
// Helper function to create a date for the given month and day in the year 2024 | |
static func dateToDisplay(month: Int, day: Int) -> Date { | |
let components = DateComponents(calendar: Calendar.current, | |
year: 2024, | |
month: month, | |
day: day) | |
return Calendar.current.date(from: components)! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment