mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-06-05 21:17:40 +00:00
Add weeks
This commit is contained in:
parent
3e0f5fe544
commit
6171fbbcb8
1 changed files with 9 additions and 3 deletions
|
@ -27,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']
|
||||
|
@ -55,6 +55,7 @@ function getTimeRemaining(endtime){
|
|||
};
|
||||
}
|
||||
let remainingDays = getTimeRemaining(dateForCountdown).days + 1;
|
||||
let remainingWeeks = Math.round(remainingDays /7);
|
||||
|
||||
// Create Widget
|
||||
let widget = new ListWidget();
|
||||
|
@ -99,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