Reputation: 13
import * as dayjs from 'dayjs'
Cannot call a namespace ('dayjs')
, TypeError: dayjs__namespace is not a function
try another
const dayjs = require('dayjs')
ReferenceError: require is not defined
How can I do?
Upvotes: 1
Views: 3164
Reputation: 56
I am using dayjs in my typescript project like below
import dayjs from 'dayjs';
:
this.date = params.get('date') ? dayjs().format('DD/MM/YYYY') : '';
Upvotes: 4