当前位置: 首页 > news >正文

tp框架做网站的优点宝安的医院网站建设

tp框架做网站的优点,宝安的医院网站建设,百度发作品入口在哪里,米拓 wordpress我们可以使用国际化API自动的格式化数字或者日期#xff0c;并且格式化日期或数字的时候是按照各个国家的习惯来进行格式化的#xff0c;非常的简单#xff1b; const now new Date(); labelDate.textContent new Intl.DateTimeFormat(zh-CN).format(now);比如说这是按照…我们可以使用国际化API自动的格式化数字或者日期并且格式化日期或数字的时候是按照各个国家的习惯来进行格式化的非常的简单 const now new Date(); labelDate.textContent new Intl.DateTimeFormat(zh-CN).format(now);比如说这是按照中国的习惯来进行格式化我们习惯按照年月日时分秒来排列时间 ● 但是这样格式化的话只能出现年月日时间却没有了 const now new Date(); const options {hour: numeric,minute: numeric,day: numeric,month: numeric,year: numeric,weekday: long, }; labelDate.textContent new Intl.DateTimeFormat(zh-CN, options).format(now);● 我们也可以直在浏览器中自动的获取你的地区无需手动的去指定地区 const now new Date(); const options {hour: numeric,minute: numeric,day: numeric,month: numeric,year: numeric,weekday: long, };const lacale navigator.language; console.log(lacale);labelDate.textContent new Intl.DateTimeFormat(lacale, options).format(now);● 再次回到我们的应用程序我们给每个用户中定义了国家码要实现每个人登录按照他国家的习惯来显示时间 const now new Date(); const options {hour: numeric,minute: numeric,day: numeric,month: numeric,year: numeric, }; labelDate.textContent new Intl.DateTimeFormat(currentAccount.locale,options ).format(now);● 除了这些存取款的时间也需要根据用户国家改变 const formatMovementDate function (date, locale) {const calcDaysPassed (date1, date2) Math.round(Math.abs(date2 - date1) / (1000 * 60 * 60 * 24));const daysPassed calcDaysPassed(new Date(), date);if (daysPassed 0) return 今天;if (daysPassed 1) return 昨天;if (daysPassed 7) return ${daysPassed} 天前;return new Intl.DateTimeFormat(locale).format(date);// const day ${date.getDate()}.padStart(2, 0);// const month ${date.getMonth() 1}.padStart(2, 0);// const year date.getFullYear();// return ${day}/${month}/${year}; };const displayMovements function (acc, sort false) {containerMovements.innerHTML ;const movs sort? acc.movements.slice().sort((a, b) a - b): acc.movements;movs.forEach(function (mov, i) {const type mov 0 ? deposit : withdrawal;const date new Date(acc.movementsDates[i]);const displayDate formatMovementDate(date, acc.locale);const html div classmovements__rowdiv classmovements__type movements__type--${type}${i 1} ${type}/divdiv classmovements__date${displayDate}/divdiv classmovements__value${mov.toFixed(2)}€/div/div;containerMovements.insertAdjacentHTML(afterbegin, html);}); };大家也可以根据下面的文档详细的学习这个国际化API INIT
http://www.hkea.cn/news/14581796/

相关文章:

  • 为网站网站做代理网站集群怎么做
  • 58同城建设银行招聘网站珠海做网站公司
  • thinkphp制作网站开发网站营销方式
  • 移动网站 模板用别人公司名字做网站违法么
  • 如何修改自己的网站标题f2fpay wordpress
  • 宜昌做网站的公司三亚同城招聘网站
  • html菜鸟入门教程中小企业网站seo
  • 适合做网站服务器的主机支付公司网站建设费怎么入账
  • 做国外购物网站推广营销
  • 做外贸用什么视频网站好北京包装设计公司排名
  • 青海建设厅通报网站网页模板快速建站工具
  • 网站技能培训班有哪些广告联盟排行榜
  • 门户网站 源码网站如何提高排名
  • 网站开发脚本语言wordpress管理密码忘记
  • 协会宣传网站开发方案南通移动网站建设
  • 如何做企业网站方法湖南网络公司排名
  • 网站服务器租赁费用中建一局
  • 如何增加网站的索引量教育网站的建设
  • 公司门户网站模板百度云搭建wordpress
  • 宣武郑州阳网站建设txt免费全本电子书软件下载网站
  • 购物网站的建设意义模板建站和定制网站的对比
  • 创立个网站专业卖手机郴州市地图高清版大图
  • 网站建设设计书数码港 太原网站开发公司
  • 企业导航网站源码企业名录app哪个好
  • 建立网站建站程序徐州建设工程交易
  • 论文写作数据网站114啦网址导航建站系统
  • 旅游响应式网站建设宜昌网站开发
  • 北京网站建设公司完美湖南岚鸿首 选定制网站建设济南
  • 苏州网站制作价格链接网站开发需要多少钱
  • 网软志成企业网站管理系统wordpress怎么设置标签分类