Created
July 3, 2024 07:37
-
-
Save velotiotech/06b07a53f6eed7b36b91505b87e71cc4 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