diff options
Diffstat (limited to 'src/core/utils/greeting.js')
| -rw-r--r-- | src/core/utils/greeting.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/utils/greeting.js b/src/core/utils/greeting.js index aaaade7a..d349033e 100644 --- a/src/core/utils/greeting.js +++ b/src/core/utils/greeting.js @@ -1,3 +1,13 @@ +/** + * Generates a greeting based on the current time of day. + * The greeting is determined by the hour of the day: + * - "Selamat Pagi" for hours before 11:00 + * - "Selamat Siang" for hours between 11:00 and 15:00 + * - "Selamat Sore" for hours between 15:00 and 18:00 + * - "Selamat Malam" for hours after 18:00 + * + * @returns {string} - The generated greeting message. + */ const greeting = () => { let hours = new Date().getHours() if (hours < 11) return 'Selamat Pagi' |
