zoukankan      html  css  js  c++  java
  • Android 与 ios获取时间戳的问题

     1 compareTime (timeStr) {
     2             const u = navigator.userAgent
     3             const isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 // Android终端
     4             const isIOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端
     5             if (isAndroid) {
     6                 // Android 识别 2020-12-14 13:32:00
     7                 return new Date(`${this.clinicDate} ${timeStr}`).getTime() < new Date().getTime()
     8             } else if (isIOS) {
     9                 // ios 不识别 2020-12-14 13:32:00  , 识别 2020/12/14 13:32:00 
    10                 return new Date(`${this.clinicDate} ${timeStr}`.replace(/-/g, '/')).getTime() < new Date().getTime()
    11             } else {
    12                 return new Date(`${this.clinicDate} ${timeStr}`).getTime() < new Date().getTime()
    13             }
    14         },
  • 相关阅读:
    用户管理
    开机、重启、用户登录注销
    网络请求的封装
    Vuex
    Promise
    Vue Router(二)
    Vue Router(一)
    Vue CLI
    前端模块化-导入导出
    插槽
  • 原文地址:https://www.cnblogs.com/-roc/p/14183592.html
Copyright © 2011-2022 走看看