index.js 313 B

12345678910111213
  1. import moment from "moment";
  2. //格式化日期函数
  3. export const formtDate = (date, v) => {
  4. return moment(date).format(v)
  5. }
  6. /* 是否在小程序内 */
  7. export const isWxprogram = () => {
  8. const userAgent = navigator.userAgent;
  9. return /miniProgram/i.test(userAgent) && /micromessenger/i.test(userAgent);
  10. }