我希望能够获得一个弹出屏幕,显示当前月份的每一天以及当天(一周)的每一天。
看起来像这样:
var dagenInMaand = [31,28,31,30,31,30,31,31,30,31,30,31];
var year = d.getYear();
var month = d.getMonth();
var d = new Date();
var t = d.getHours();
if(t >= '0' && t <= '6'){
var g = nacht;
}else if(t >= '6' && t <= '9'){
var g = morgen;
}else if(t >= '9' && t <= '17'){
var g = middag;
}else{
var g = avond;
}
这是一个每月最多天数的数组
var j = d.getDay();
if(j == '1'){
var a = "Maandag"
}else if(j == '2'){
var a = "dinsdag"
}else if(j == '3'){
var a = "woensdag"
}else if(j == '4'){
var a = "donderdag"
}else if(j == '5'){
var a = "vrijdag"
}else if(j == '6'){
var a = "zaterdag"
}else{
var a = "zondag"
}
document.getElementById("demo").innerHTML = "Goede " + g + ", het is vandaag " + a + ".";
function getDaysOfWeekDescription()
{
}
</script>
</body>
这些是我一周的日子,但它最初来自另一个功能,但它不想再工作了
{{1}}
答案 0 :(得分:0)
根据Malith McR的评论,这是一个更新的小提琴: http://jsfiddle.net/jL9resy1/1/
这会构建数组。它目前会提醒它,但可以修改弹出窗口以便以您选择的任何方式处理数组。
var weekday = ["Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday"]; //these are obviously in english
function getDaysInMonth() {
var date = new Date();
var days = [];
while (date.getMonth()) {
days.push(weekday[date.getDay()] + " " + (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear());
date.setDate(date.getDate() + 1);
}
return days;
}
alert(getDaysInMonth());
答案 1 :(得分:0)
SELECT c.*,
state.abbreviation AS state,
country.abbreviation AS country
FROM main_customers AS c JOIN
(SELECT customerId, COUNT(*) as cnt
FROM main_orders
GROUP BY customerId
) mo
ON mo.customerId = c.id LEFT JOIN
dict_stateProvince AS state
ON c.state = state.id LEFT JOIN
dict_country AS country
ON c.country = country.id
ORDER BY mo.cnt DESC;
var d = new Date();
var t = d.getHours();
if(t >= '0' && t <= '6'){
var g = "nacht";
}else if(t >= '6' && t <= '9'){
var g = "morgen";
}else if(t >= '9' && t <= '17'){
var g = "middag";
}else{
var g = "avond";
}
var dagen = {
1 : "maandag",
2 : "dinsdag",
3 : "woensdag",
4 : "donderdag",
5 : "vrijdag",
6 : "zaterdag",
0 : "zondag"
};
var maanden = {
0 : "januari",
1 : "februari",
2 : "maart",
3 : "april",
4 : "mei",
5 : "juni",
6 : "juli",
7 : "augustus",
8 : "september",
9 : "oktober",
10 : "november",
11 : "december"
};
document.getElementById("demo").innerHTML = "Goede " + g + ", het is vandaag " + dagen[d.getDay()] + " " + d.getDate() + " " + maanden[d.getMonth()] + " " + d.getFullYear() +".";
我认为这就是获取约会的意思。