This commit is contained in:
David Ralph
2019-01-21 18:06:35 +00:00
parent f14e286f76
commit a532449261
3 changed files with 12 additions and 26 deletions

View File

@@ -21,13 +21,10 @@ const { setHTMLContent } = require('./utility.js');
module.exports = class Message {
// English
static engMessageSet() {
let hour = new Date().getHours(); // Get the current hour
let time = 'Good evening'; // Set the default time string to "Good evening"
if (hour < 12) time = 'Good morning'; //If it's before 12am, set the time string to "Good morning"
else if (hour > 18) time = 'Good afternoon'; //If it's after 6pm, set the time string to "Good afternoon"
setHTMLContent('.greeting', time); // Write the string contents to the HTML
}
@@ -35,9 +32,7 @@ module.exports = class Message {
static itMessageSet() {
let hour = new Date().getHours(); // Get the current hour
let time = 'Buongiorno';
if (hour > 18) time = 'Buonasera'; //In Italian there is just Buongiorno or Buonasera
setHTMLContent('.greeting', time); // Write the string contents to the HTML
}
@@ -45,10 +40,8 @@ module.exports = class Message {
static nlMessageSet() {
let hour = new Date().getHours(); // Get the current hour
let time = 'Goedemiddag'; // Set the default time string to "Good evening"
if (hour < 12) time = 'Goedemorgen'; //If it's before 12am, set the time string to "Good morning"
else if (hour > 18) time = 'Goedenavond'; //If it's after 6pm, set the time string to "Good afternoon"
setHTMLContent('.greeting', time); // Write the string contents to the HTML
}
@@ -56,10 +49,8 @@ module.exports = class Message {
static frMessageSet() {
let hour = new Date().getHours(); // Get the current hour
let time = 'Bonsoir'; // Set the default time string to "Good evening"
if (hour < 12) time = 'Bonjour'; //If it's before 12am, set the time string to "Good morning"
else if (hour > 18) time = 'Bonne après-midi'; //If it's after 6pm, set the time string to "Good afternoon"
setHTMLContent('.greeting', time); // Write the string contents to the HTML
}
@@ -67,10 +58,8 @@ module.exports = class Message {
static spMessageSet() {
let hour = new Date().getHours(); // Get the current hour
let time = 'Buenas Tardes'; // Set the default time string to "Good evening"
if (hour < 12) time = 'Buenos Días'; // If it's before 12am, set the time string to "Good morning"
else if (hour > 20) time = 'Buenas Noches'; // If it's after 6pm, set the time string to "Good afternoon"
setHTMLContent('.greeting', time); // Write the string contents to the HTML
}
}