-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URLs #170
Comments
Hi there, I'm so glad to hear you're enjoying the widget! Both of these are great ideas, and I'm so excited that there's finally a way to open the weather app via URL in iOS 16! The const secondsForToday = Math.floor(new Date().getTime() / 1000) - 978307200
const calendarUrl = "calshow:" + secondsForToday A variation of this calculation is used around line 1053 to make each calendar event tappable, and the calendar will show the day of the event. A similar approach could be used for the date element! |
Oh thanks for the info now I understand why there's I got it working in this way: // Display the date on the widget.
async date(column) {
const secondsForToday = Math.floor(new Date().getTime() / 1000) - 978307200
const dateUrl = "calshow:" + secondsForToday
const dateSettings = this.settings.date
if (!this.data.events && dateSettings.dynamicDateSize) { await this.setupEvents() }
if (dateSettings.dynamicDateSize ? this.data.events.length : dateSettings.staticDateSize == "small") {
this.provideText(this.formatDate(this.now,dateSettings.smallDateFormat), column, this.format.smallDate, true)
column.url = dateUrl
} else {
const dateOneStack = this.align(column)
const dateOne = this.provideText(this.formatDate(this.now,dateSettings.largeDateLineOne), dateOneStack, this.format.largeDate1)
dateOneStack.setPadding(this.padding/2, this.padding, 0, this.padding)
dateOneStack.url = dateUrl
const dateTwoStack = this.align(column)
const dateTwo = this.provideText(this.formatDate(this.now,dateSettings.largeDateLineTwo), dateTwoStack, this.format.largeDate2)
dateTwoStack.setPadding(0, this.padding, this.padding, this.padding)
dateTwoStack.url = dateUrl
}
}, for sure it would be interesting to also add a setting for a default app (if not calendar) but since my knowledge is limited to HTML and CSS I'm already satisfied with this one 😂 Thank you for the suggestion! |
I just submitted a pull request that does all of these things @mzeryck |
Thanks @epizzarello I'm using your code, everything works fine! Is it also possibile to add an url to the background, when an empty space is tapped? Or this can only be done out from scriptable in the widget setting? |
@EnricoBara I don't know of a way to add a url to the background other than the widget settings, sorry! |
No problem thanks anyway! |
Hi Max, I just discovered your widget and I don't know how I survived 1 year with the black calendar widget 😂 my compliments for your work, it's soo useful and really easy to set it up and customise! And moreover many many thanks for sharing it!
May I ask you if you can add a url for opening the calendar when I click the "date" element? Or if you can help me with a little input I'll update the code by myself.
edit: added
calshow://
on the widget url (out from scriptable) as a workaround but it doesn't lands on todayAlso, what's the url of the apple weather app for opening it instead of open weather?
edit: found
weather://
opens weather in iOS 16!!!Kind regards
The text was updated successfully, but these errors were encountered: