Permalink
Browse files

fix: IUAPDESIGN:云表单:日期年月ios获取bug

  • Loading branch information...
Boyuzhou
Boyuzhou committed Nov 11, 2016
1 parent f65276b commit 02c2f800f661fba6136f47f9d3fb8c6532ee4af8
Showing with 4 additions and 4 deletions.
  1. +4 −4 js/util.js
View
@@ -128,9 +128,9 @@ var dateFormat = function ( str ) {
}
//判断 str 格式如果是 yy-mm-dd
if (str && str.indexOf ('-') > -1){
//获取当前是否是 ios版本
var ua = navigator.userAgent.toLowerCase();
if (/iphone|ipad|ipod/.test(ua)) {
//获取当前是否是 ios版本,>8是因为ios不识别new Date(“2016/11”)格式
var ua = navigator.userAgent.toLowerCase();
if (/iphone|ipad|ipod/.test(ua) && str.length > 8) {
//转换成 yy/mm/dd
str = str.replace(/-/g,"/");
}
@@ -152,4 +152,4 @@ export {
isDomElement,
each,
dateFormat
};
};

0 comments on commit 02c2f80

Please sign in to comment.