| 1234567891011121314151617181920212223 |
- import moment from 'moment'
- class UseDate {
- private $moment:typeof moment;
- constructor(momentInstance:any) {
- this.$moment = momentInstance
- }
- handleFormattedDate(dates:any){
- const d_format:Array<string> = []
- if(dates instanceof Array){
- for(const date of dates){
- d_format.push(this.$moment(date).format('DD/MM/YYYY'))
- }
- }else{
- d_format.push(this.$moment(dates as string).format('DD/MM/YYYY'))
- }
- return d_format.join(' - ')
- }
- }
- export const $useDate = (momentInstance: typeof moment) => new UseDate(momentInstance)
|