這可能是一個令人尷尬的簡單問題,但我對Moment.js和fullcalendar不熟悉。 目標:獲取fullcalendar來了一下/日期是幾分鐘從本地計算機的時間偏移操作。 的理由: 我們希望,而不是桌面的時間顯示時間和nowIndicator與老鍾在建築物同步。 到目前爲止已經試過: // Get current offset:
var localOffset = moment().utc
我已經安裝了片刻JS npm install moment --save
然後在我的根app.js import moment from "moment";
在我的組件 現在正試圖 to: moment().day(2).format('YYYY-MM-DD')
但以上返回錯誤 ReferenceError: moment is not defined"
WWhat可能是錯的?
我嘗試茉莉花與moment.js一起選擇,但我得到這個錯誤... debug.js:21 Uncaught TypeError: (0 , _moment.moment) is not a function
不知道如果它與moment.js相關,或者如果我設置不正確。感謝任何幫助。 //script.js
import { moment } from 'moment';