diff --git a/resources/js/Global/utils/date/jalali-date.js b/resources/js/Global/utils/date/jalali-date.js index af6380d..663f94f 100644 --- a/resources/js/Global/utils/date/jalali-date.js +++ b/resources/js/Global/utils/date/jalali-date.js @@ -1,9 +1,10 @@ import moment from "jalali-moment"; +import Vue from "vue"; const convertToJalali = function (date = null, format = "jYYYY/jMM/jDD", defaultDate = 'مشخص نشده است.' ) { - return date ? moment(date).format(format) : defaultDate ; + return date ? Vue.prototype.$moment(date).format(format) : defaultDate ; }; const convertNowToJalali = function (date = null, format = "jYYYY/jMM/jDD" ) { - return date ? moment(date).format(format) : moment(new Date()).format(format) ; + return date ? Vue.prototype.$moment(date).format(format) : Vue.prototype.$moment(new Date()).format(format) ; }; export { convertToJalali, convertNowToJalali };