import { defineStore } from "pinia";
import moment from "moment";
export const useDatePickerStore = defineStore({
    id: "datePickerStore",
    state: () => ({
        
        toolbar:
            "undo redo styles | bold italic backcolor link image alignleft aligncenter alignright alignjustify bullist numlist outdent indent removeformat fullscreen",
        plugins:
            "advlist autolink lists link image charmap print preview anchor searchreplace visualblocks code fullscreen media table paste code wordcount",
        fileList: [],
        init: { entity_encoding: "raw", promotion: false, language: "vi" },
    }),
    actions: {
        format: (dates) => {
            let start = dates[0];
            let end = dates[1];

            var startMoment = moment(start);
            var endMoment = moment(end);

            return `${startMoment.format("DD/MM/yyyy")} - ${endMoment.format("DD/MM/yyyy")}`;
        },
    }
});
