角UI引导当前日期(今天)的亮点不选择 [英] Angular ui bootstrap current date (today) highlight without selecting
本文介绍了角UI引导当前日期(今天)的亮点不选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Angular.UI引导日期选择器( HTTP://angular-ui.github .IO /引导/#/日期选择器)
I am using Angular.UI Bootstrap Datepicker (http://angular-ui.github.io/bootstrap/#/datepicker)
现在我挑战一个问题:客户总是希望看到当前日期强调,即使没有选中。在这个例子只是想( http://angular-ui.github.io/ui-date/ )。
Now I am challenging one problem: the client always wants to see current date highlighted, even if it is not selected. Just like in this example (http://angular-ui.github.io/ui-date/).
试图谷歌这个问题,但没有解决发现Angular.UI引导日期选择器。
Tried to google this problem, but no solution found for Angular.UI Bootstrap Datepicker.
有没有办法,切换到用户界面的更新。任何想法?
There is no way, to switch to ui-date. Any ideas?
感谢您!
推荐答案
替换日期选择器控制这种
Replace in the datepicker control this
var days = getDates(firstDate, numDates), labels = new Array(7);
for (var i = 0; i < numDates; i++) {
var dt = new Date(days[i]);
days[i] = makeDate(dt, format.day, (selected && selected.getDate() === dt.getDate() && selected.getMonth() === dt.getMonth() && selected.getFullYear() === dt.getFullYear()), dt.getMonth() !== month);
}
与
var today = new Date();
var days = getDates(firstDate, numDates), labels = new Array(7);
for (var i = 0; i < numDates; i++) {
var dt = new Date(days[i]);
var highlight = (selected && selected.getDate() === dt.getDate() && selected.getMonth() === dt.getMonth() && selected.getFullYear() === dt.getFullYear());
if(!highlight) {
highlight = (today.getDate() === dt.getDate() && today.getMonth() === dt.getMonth() && today.getFullYear() === dt.getFullYear());
}
days[i] = makeDate(dt, format.day, highlight, dt.getMonth() !== month);
}
这篇关于角UI引导当前日期(今天)的亮点不选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文