qcal/src/App.tsx

17 lines
548 B
TypeScript
Raw Normal View History

2022-02-12 15:40:45 -05:00
import React, {useState} from 'react';
import './App.css';
2022-02-12 13:02:31 -05:00
import {Calendar} from './Calendar';
2022-02-12 15:40:45 -05:00
import {gregorianJDN, Month} from "./dates";
function App() {
2022-02-12 15:40:45 -05:00
const today = new Date();
const todayJDN = gregorianJDN(today.getFullYear(), today.getMonth() + 1, today.getDay());
const [yearMonth, setYearMonth] = useState([230, 5]);
return (
<Calendar year={yearMonth[0]} month={yearMonth[1] as Month} todayJDN={todayJDN}
onSwitch={(year, month) => setYearMonth([year, month])}/>
);
}
export default App;