mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Merge pull request #2641 from rejas/issue_2462
Actually use showTime parameter in clock module
This commit is contained in:
commit
f71defe958
@ -11,7 +11,7 @@ _This release is scheduled to be released on 2021-10-01._
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Added showTime parameter to clock module for enabling/disabling time display in analog clock
|
- Added showTime parameter to clock module for enabling/disabling time display in digital clock
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ Module.register("clock", {
|
|||||||
showPeriodUpper: false,
|
showPeriodUpper: false,
|
||||||
clockBold: false,
|
clockBold: false,
|
||||||
showDate: true,
|
showDate: true,
|
||||||
showTime: false,
|
showTime: true,
|
||||||
showWeek: false,
|
showWeek: false,
|
||||||
dateFormat: "dddd, LL",
|
dateFormat: "dddd, LL",
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ Module.register("clock", {
|
|||||||
digitalWrapper.appendChild(dateWrapper);
|
digitalWrapper.appendChild(dateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.config.showTime || this.config.displayType !== "analog") {
|
if (this.config.displayType !== "analog" && this.config.showTime) {
|
||||||
timeWrapper.innerHTML = timeString;
|
timeWrapper.innerHTML = timeString;
|
||||||
secondsWrapper.innerHTML = now.format("ss");
|
secondsWrapper.innerHTML = now.format("ss");
|
||||||
if (this.config.showPeriodUpper) {
|
if (this.config.showPeriodUpper) {
|
||||||
|
1289
package-lock.json
generated
1289
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -47,11 +47,11 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-jest": "^24.4.0",
|
"eslint-plugin-jest": "^24.4.0",
|
||||||
"eslint-plugin-jsdoc": "^36.0.7",
|
"eslint-plugin-jsdoc": "^36.0.8",
|
||||||
"eslint-plugin-prettier": "^3.4.1",
|
"eslint-plugin-prettier": "^3.4.1",
|
||||||
"express-basic-auth": "^1.2.0",
|
"express-basic-auth": "^1.2.0",
|
||||||
"husky": "^7.0.1",
|
"husky": "^7.0.2",
|
||||||
"jest": "^27.0.6",
|
"jest": "^27.1.0",
|
||||||
"jsdom": "^17.0.0",
|
"jsdom": "^17.0.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
@ -65,7 +65,7 @@
|
|||||||
"stylelint-prettier": "^1.2.0"
|
"stylelint-prettier": "^1.2.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"electron": "^13.2.1"
|
"electron": "^13.2.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
@ -81,7 +81,7 @@
|
|||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"node-ical": "^0.13.0",
|
"node-ical": "^0.13.0",
|
||||||
"simple-git": "^2.44.0",
|
"simple-git": "^2.45.0",
|
||||||
"socket.io": "^4.1.3"
|
"socket.io": "^4.1.3"
|
||||||
},
|
},
|
||||||
"_moduleAliases": {
|
"_moduleAliases": {
|
||||||
|
23
tests/configs/modules/clock/clock_showTime.js
Normal file
23
tests/configs/modules/clock/clock_showTime.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/* Magic Mirror Test config for default clock module
|
||||||
|
*
|
||||||
|
* By Johan Hammar
|
||||||
|
* MIT Licensed.
|
||||||
|
*/
|
||||||
|
let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
|
||||||
|
timeFormat: 12,
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "clock",
|
||||||
|
position: "middle_center",
|
||||||
|
config: {
|
||||||
|
showTime: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
module.exports = config;
|
||||||
|
}
|
@ -85,6 +85,19 @@ describe("Clock module", function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("with showTime config disabled", function () {
|
||||||
|
beforeAll(function () {
|
||||||
|
// Set config sample for use in test
|
||||||
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_showTime.js";
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should show not show the time when digital clock is shown", async function () {
|
||||||
|
await app.client.waitUntilWindowLoaded();
|
||||||
|
const time = await app.client.$$(".clock .digital .time");
|
||||||
|
return expect(time.length).toBe(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("with showWeek config enabled", function () {
|
describe("with showWeek config enabled", function () {
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
// Set config sample for use in test
|
// Set config sample for use in test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user