import dayjs from "dayjs";
import {Box} from "@mui/material";
import React from "react";

export interface PeriodTextProps {
    startAt: Date,
    endAt?: Date,
    format: string
}


function PeriodText(props: PeriodTextProps) {

    const start = dayjs(props.startAt).format(props.format);
    const end = props.endAt ? dayjs(props.endAt).format(props.format) : "now";

    return (<Box>
        {start} - {end}
    </Box>);
}

export default PeriodText;
