mirror of
https://github.com/quantum5/qcal.git
synced 2025-07-26 19:34:10 -04:00
mcal: add labels for different information
This commit is contained in:
parent
1fd038e900
commit
2c352f880c
|
@ -14,6 +14,7 @@ import {
|
||||||
jdnHaabExt,
|
jdnHaabExt,
|
||||||
jdnLordOfNight, jdnTzolkin,
|
jdnLordOfNight, jdnTzolkin,
|
||||||
} from '@common/mayan';
|
} from '@common/mayan';
|
||||||
|
import {useMobileTooltipProps} from '@common/ui/MobileTooltip';
|
||||||
|
|
||||||
type MonthProps = {
|
type MonthProps = {
|
||||||
year: HaabYear;
|
year: HaabYear;
|
||||||
|
@ -26,12 +27,21 @@ type DateProps = MonthProps & {
|
||||||
|
|
||||||
function Day({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JSX.Element {
|
function Day({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JSX.Element {
|
||||||
const jdn = haabExtJDN({year, month, day});
|
const jdn = haabExtJDN({year, month, day});
|
||||||
|
const mobile = useMobileTooltipProps();
|
||||||
return <div className={`Day ${jdn === todayJDN ? 'Day-today' : ''}`}>
|
return <div className={`Day ${jdn === todayJDN ? 'Day-today' : ''}`}>
|
||||||
<div className="Day-name">{day}<span className="Day-haabMonth"> {haabNames[month]}</span></div>
|
<div className="Day-name">{day}<span className="Day-haabMonth"> {haabNames[month]}</span></div>
|
||||||
<div className="Day-tzolkin">{formatTzolkin(jdnTzolkin(jdn))}</div>
|
<div className="Day-tzolkin">
|
||||||
<div className="Day-lc">{jdnLongCount(jdn)?.join('.')}</div>
|
<abbr title="Tzolkʼin" {...mobile}>T.</abbr> {formatTzolkin(jdnTzolkin(jdn))}
|
||||||
<div className="Day-lordOfNight">{formatLordOfNight(jdnLordOfNight(jdn))}</div>
|
</div>
|
||||||
<div className="Day-gregorian">{jdnDate(jdn).toDateString()}</div>
|
<div className="Day-lc">
|
||||||
|
<abbr title="Long count" {...mobile}>L.</abbr> {jdnLongCount(jdn)?.join('.')}
|
||||||
|
</div>
|
||||||
|
<div className="Day-lordOfNight">
|
||||||
|
<abbr title="Lord of the Night" {...mobile}>N.</abbr> {formatLordOfNight(jdnLordOfNight(jdn))
|
||||||
|
}</div>
|
||||||
|
<div className="Day-gregorian">
|
||||||
|
<abbr title="Gregorian date" {...mobile}>G.</abbr> {jdnDate(jdn).toDateString()}
|
||||||
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue