MagicMirror² frontend-only module that displays age rows for multiple people with accurate year/month/day calculations.
- Copy the
MMM-AgeWidgetfolder into your MagicMirrormodulesdirectory. - Add the module to your
config.js.
Module config options
people(array): list of peopleevents(array): list of global anniversaries/custom eventsname(string)date(string) inYYYY-MM-DDemoji(optional string)text(optional string): template for normal days, supports{name}and{years}todayText(optional string): template for event day, supports{name}and{years}name(string)dob(string) inYYYY-MM-DDmode(optional string):adult|child|babyshowYears/showMonths/showDays(optional booleans): per-person overrides
mode(string): default mode for people without a per-person modeshowYears/showMonths/showDays(boolean|null): global defaults (overridden by person)title(string)showTitle(boolean)separator(string): default" — "showOldSuffix(boolean)inline(boolean|null): override auto inline mode fortop_bar/bottom_barwhen settextAlign(string):left,center, orright- Inline bar layout: auto-enabled for
top_barandbottom_bar, uses|between people and hides the title locale(string):enormsupdateInterval(number ms): periodic refresh, default ~1 hourupdateAtMidnight(boolean): update at local midnighthighlightBirthday(boolean)showBirthdayMessage(boolean): replace line with birthday messagebirthdayEmoji(string): default"🎂"
{
module: "MMM-AgeWidget",
position: "top_left",
config: {
title: "Ages",
mode: "adult",
people: [
{ name: "Rizal", dob: "1993-01-28" }
]
}
}{
module: "MMM-AgeWidget",
position: "top_left",
config: {
mode: "child",
people: [
{ name: "Yuna", dob: "2022-06-04" }
]
}
}{
module: "MMM-AgeWidget",
position: "top_left",
config: {
mode: "baby",
people: [
{ name: "Aria", dob: "2024-11-01" }
]
}
}{
module: "MMM-AgeWidget",
position: "top_left",
config: {
locale: "ms",
showOldSuffix: false,
people: [
{ name: "Aiman", dob: "1990-03-10" }
]
}
}{
module: "MMM-AgeWidget",
position: "bottom_bar",
config: {
events: [
{ name: "Rizal & Yuna", date: "2019-06-01", emoji: "🎉", text: "{years} years together" },
{ name: "Company Founded", date: "2012-03-15", text: "{years} years since founding", todayText: "🎉 {name} turns {years} today!" }
]
}
}- Date values must be
YYYY-MM-DDfor people and events. - Ages are calculated using calendar-aware year/month/day logic (leap years and month lengths handled).
- The module updates at local midnight when
updateAtMidnightis true. top_barandbottom_barpositions render inline with a|separator between people and no title (override withinline).