Java 日期和时间
嘿伙计们,我想找到一些有关 java 和日历类的信息。我需要写一个 if 语句,说明如果是周末,即周六或周日,则执行此操作,否则执行此
操作干杯
,感谢您的帮助,但我认为我没有正确实现它,现在没有显示任何内容。
$(document).ready(function() {
function recalculate() {
var sum = 49;
int day = Calendar.getInstance().get( Calendar.DAY_OF_WEEK );
if ( day == Calendar.SATURDAY || day == Calendar.SUNDAY ){
sum = 80;
}
$("input[type=checkbox]:checked").each(function() {
sum = parseInt($(this).attr("rel"));
});
$("#output").html(sum);
}
$("input[type=checkbox]").change(function() {
recalculate();
});
});
Hey guys im trying to find some info regarding java and the calendar class. I need to write an if statement that says if it is a weekend i.e sat or sunday then do this else do this
Cheers
Thanks for the help however i don't think im implementing it correctly, nothing is being displayed now.
$(document).ready(function() {
function recalculate() {
var sum = 49;
int day = Calendar.getInstance().get( Calendar.DAY_OF_WEEK );
if ( day == Calendar.SATURDAY || day == Calendar.SUNDAY ){
sum = 80;
}
$("input[type=checkbox]:checked").each(function() {
sum = parseInt($(this).attr("rel"));
});
$("#output").html(sum);
}
$("input[type=checkbox]").change(function() {
recalculate();
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
一切都在这里:
http://download.oracle.com/javase/6 /docs/api/java/util/Calendar.html
It's all in here:
http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html
另请参阅
See Also
@Simone 你那里的代码看起来一点也不像Java - 事实上,它更像是JQuery 格式的JavaScript。不管怎样,@Matthew 和@Jigar 已经为您提供了示例代码。
如果这没有帮助,他们会确保下次将您的问题标记为 Javascript,以便有相关经验的人可以帮助回答您的问题。
祝你好运
@Simone The code you have there does not look anything like Java - infact, it's more like JavaScript in JQuery format. Anyway, @Matthew and @Jigar have provided you with sample code.
If that does not help, them make sure to tag your question as Javascript next time so that people with that experience can help answer your question.
Good luck