更改Angular ui-bootstrap datepicker日期 [英] Change Angular ui-bootstrap datepicker day order

查看:318
本文介绍了更改Angular ui-bootstrap datepicker日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,ui-bootstrap datepicker弹出窗口命令星期一星期一。
我有一个客户的请求来重新排序他们太阳星期六

Currently the ui-bootstrap datepicker popup orders the days of the week Mon-Sun. I have a request from a customer to reorder them Sun-Sat

有趣的是,在ui-bootstrap页面上,内联示例有Sun-Mon命令但是弹出窗口是Mon-Sun。

Interestingly, on the ui-bootstrap page, the inline example has the Sun-Mon order but the popup is Mon-Sun.

有没有办法更改弹出窗口中的日期顺序?
我没有在我的谷歌搜索中找到关于该主题的任何信息。

Is there a way to change the day order in the popup? I have not found any info on that topic in my googling.

推荐答案

安德鲁,在 Datepicker文档,在弹出设置小标题下,它说datepicker的选项可以作为JSON传递使用datepicker-options属性,这是我处理您遇到的同样问题的关键。

Andrew, in the Datepicker docs, under the "Popup Settings" subheading, it says "Options for datepicker can be passed as JSON using the datepicker-options attribute", which was the key piece for me in tackling the same problem you're facing.

请参阅此JSFiddle ,它简化了来自angular-ui.github.io的示例代码,并包含我认为您需要的位。请注意,您需要更改为骆驼案例startingDay拼写:

See this JSFiddle, which simplifies the example code from angular-ui.github.io, and contains the bits I think you need. Note that you need to change to camel case "startingDay" spelling:

$scope.dateOptions = {
  formatYear: 'yy',
  showWeeks: false,      
  startingDay: 0
};

这篇关于更改Angular ui-bootstrap datepicker日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆