diff --git a/apps/boxclk/ChangeLog b/apps/boxclk/ChangeLog index ba46af04e..f35b35819 100644 --- a/apps/boxclk/ChangeLog +++ b/apps/boxclk/ChangeLog @@ -1,2 +1,3 @@ 0.01: New App! 0.02: New config options such as step, meridian, short/long formats, custom prefix/suffix +0.03: Allows showing the month in short or long format by setting `"shortMonth"` to true or false diff --git a/apps/boxclk/README.md b/apps/boxclk/README.md index 8f5075dd0..0bb2cdede 100644 --- a/apps/boxclk/README.md +++ b/apps/boxclk/README.md @@ -39,6 +39,7 @@ Here's what an example configuration might look like: "suffix": "", // Adds a string to the end of the main string "disableSuffix": true, // Use to remove DayOfMonth suffix only "short": false // Use long format of time, meridian, date, or DoW + "shortMonth": false // Use long format of month within date }, "bg": { // Can also be removed for no background @@ -75,9 +76,11 @@ __Breakdown of Parameters:__ * **suffix:** Adds a string to the end of the main string. For example, you can set "suffix": "%" to display "80%" for the battery percentage. -* **disableSuffix:** Applies only to the "date" box. Set to true to disable the DayOfMonth suffix. This is used to remove the "st","nd","rd", or "th" from the DayOfMonth number +* **disableSuffix:** Applies only to the "date" box. Set to true to disable the DayOfMonth suffix. This is used to remove the "st","nd","rd", or "th" from the DayOfMonth number. -* **short:** Set to false to get the long format value of time, meridian, date, or DayOfWeek. Short formats are used by default, +* **short:** Set to false to get the long format value of time, meridian, date, or DayOfWeek. Short formats are used by default if not specified. + +* **shortMonth:** Set to false to get the long format value of the month. Short format is used by default if not specified. * **bg:** This specifies a custom background image, with the img property defining the name of the image file on the Bangle.js storage. diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 41636e1ef..0b0ca8e65 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -171,10 +171,10 @@ return typeof val !== 'undefined' ? Boolean(val) : defaultVal; }; - let getDate = function(short, disableSuffix) { + let getDate = function(short, shortMonth, disableSuffix) { const date = new Date(); const dayOfMonth = date.getDate(); - const month = short ? locale.month(date, 0) : locale.month(date, 1); + const month = shortMonth ? locale.month(date, 1) : locale.month(date, 0); const year = date.getFullYear(); let suffix; if ([1, 21, 31].includes(dayOfMonth)) { @@ -228,7 +228,12 @@ boxes.meridian.string = modString(boxes.meridian, locale.meridian(date, isBool(boxes.meridian.short, true))); } if (boxes.date) { - boxes.date.string = modString(boxes.date, getDate(isBool(boxes.date.short, true), isBool(boxes.date.disableSuffix, false))); + boxes.date.string = ( + modString(boxes.date, + getDate(isBool(boxes.date.short, true), + isBool(boxes.date.shortMonth, true), + isBool(boxes.date.disableSuffix, false) + ))); } if (boxes.dow) { boxes.dow.string = modString(boxes.dow, getDayOfWeek(date, isBool(boxes.dow.short, true))); @@ -395,4 +400,4 @@ widgets.swipeOn(); modSetColor(); setup(); -} +} \ No newline at end of file diff --git a/apps/boxclk/metadata.json b/apps/boxclk/metadata.json index 7ee6e1638..6717b79d8 100644 --- a/apps/boxclk/metadata.json +++ b/apps/boxclk/metadata.json @@ -1,7 +1,7 @@ { "id": "boxclk", "name": "Box Clock", - "version": "0.02", + "version": "0.03", "description": "A customizable clock with configurable text boxes that can be positioned to show your favorite background", "icon": "app.png", "screenshots": [