mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-06-05 21:17:40 +00:00
Merge b54e9db094
into 59fe28e46e
This commit is contained in:
commit
4091a6f72d
1 changed files with 11 additions and 4 deletions
|
@ -17,6 +17,7 @@ if (widgetInputRAW !== null) {
|
|||
}
|
||||
dateForCountdown = widgetInput[0].trim()
|
||||
icon = widgetInput[1] || '⏳';
|
||||
text = widgetInput[3]; // new
|
||||
if (widgetInput[2] && widgetInput[2].toLowerCase() === 'true') {
|
||||
showDate = true
|
||||
}
|
||||
|
@ -26,9 +27,9 @@ if (widgetInputRAW !== null) {
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const localeText = {
|
||||
default: ['Day', 'Days'],
|
||||
en: ['Day', 'Days'],
|
||||
de: ['Tag', 'Tage'],
|
||||
default: ['Day', 'Days', 'weeks'],
|
||||
en: ['Day', 'Days', 'Weeks'],
|
||||
de: ['Tag', 'Tage', 'Wochen'],
|
||||
fr: ['Jour', 'Jours'],
|
||||
es: ['día', 'días'],
|
||||
it: ['giorno', 'giorni']
|
||||
|
@ -54,6 +55,7 @@ function getTimeRemaining(endtime){
|
|||
};
|
||||
}
|
||||
let remainingDays = getTimeRemaining(dateForCountdown).days + 1;
|
||||
let remainingWeeks = Math.round(remainingDays*10 /7)/10;
|
||||
|
||||
// Create Widget
|
||||
let widget = new ListWidget();
|
||||
|
@ -69,7 +71,7 @@ gradient.colors = [
|
|||
widget.backgroundGradient = gradient
|
||||
|
||||
|
||||
let provider = widget.addText(icon + " Countdown")
|
||||
let provider = widget.addText(icon + " " + text) // variant
|
||||
provider.font = Font.mediumSystemFont(12)
|
||||
provider.textColor = textColor
|
||||
|
||||
|
@ -98,6 +100,11 @@ if (remainingDays === 1) {
|
|||
}
|
||||
postfixText.font = Font.regularSystemFont(20)
|
||||
postfixText.textColor = textColor;
|
||||
let provider2 = widget.addText(remainingWeeks+ " " + (t[2]))
|
||||
provider2.font = Font.mediumSystemFont(16)
|
||||
provider2.textColor = textColor
|
||||
provider2.centerAlignText()
|
||||
textStack.addSpacer()
|
||||
|
||||
textStack.addSpacer()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue