[Settings] Add new option for selecting the first day of the week

pull/1773/head
Alessandro Cocco 2022-05-01 22:42:28 +02:00
parent ce06879fe4
commit 74db2585d7
2 changed files with 24 additions and 13 deletions

View File

@ -7,7 +7,7 @@ This is Bangle.js's settings menu
* **Beep** most Bangle.js do not have a speaker inside, but they can use the vibration motor to beep in different pitches. You can change the behaviour here to use a Piezo speaker if one is connected
* **Vibration** enable/disable the vibration motor
* **Quiet Mode** prevent notifications/alarms from vibrating/beeping/turning the screen on - see below
* **Locale** set time zone/whether the clock is 12/24 hour (for supported clocks)
* **Locale** set time zone, the time format (12/24h, for supported clocks) and the first day of the week
* **Select Clock** if you have more than one clock face, select the default one
* **Set Time** Configure the current time - Note that this can be done much more easily by choosing 'Set Time' from the App Loader
* **LCD** Configure settings about the screen. How long it stays on, how bright it is, and when it turns on - see below.

View File

@ -37,18 +37,19 @@ function internalToG(u) {
function resetSettings() {
settings = {
ble: true, // Bluetooth enabled by default
blerepl: true, // Is REPL on Bluetooth - can Espruino IDE be used?
log: false, // Do log messages appear on screen?
quiet: 0, // quiet mode: 0: off, 1: priority only, 2: total silence
timeout: 10, // Default LCD timeout in seconds
vibrate: true, // Vibration enabled by default. App must support
beep: BANGLEJS2?true:"vib", // Beep enabled by default. App must support
timezone: 0, // Set the timezone for the device
HID: false, // BLE HID mode, off by default
clock: null, // a string for the default clock's name
"12hour" : false, // 12 or 24 hour clock?
brightness: 1, // LCD brightness from 0 to 1
ble: true, // Bluetooth enabled by default
blerepl: true, // Is REPL on Bluetooth - can Espruino IDE be used?
log: false, // Do log messages appear on screen?
quiet: 0, // quiet mode: 0: off, 1: priority only, 2: total silence
timeout: 10, // Default LCD timeout in seconds
vibrate: true, // Vibration enabled by default. App must support
beep: BANGLEJS2 ? true : "vib", // Beep enabled by default. App must support
timezone: 0, // Set the timezone for the device
HID: false, // BLE HID mode, off by default
clock: null, // a string for the default clock's name
"12hour" : false, // 12 or 24 hour clock?
firstDayOfWeek: 0, // 0 -> Sunday (default), 1 -> Monday
brightness: 1, // LCD brightness from 0 to 1
// welcomed : undefined/true (whether welcome app should show)
options: {
wakeOnBTN1: true,
@ -493,6 +494,16 @@ function showLocaleMenu() {
settings["12hour"] = v;
updateSettings();
}
},
/*LANG*/'Start Week On': {
value: settings["firstDayOfWeek"] || 0,
min: 0, // Sunday
max: 1, // Monday
format: v => require("date_utils").dow(v, 1),
onchange: v => {
settings["firstDayOfWeek"] = v;
updateSettings();
},
}
};
return E.showMenu(localemenu);