-1
我有一个代码,循环days.this使叶子。我希望列出登录和注册出席将在startdate自动填充开始并在enddate结束。
**exp I input :**
startdate: 2012-11-08 01:30:00
enddate: 2012-11-10 01:30:00
**i want output like this:**
2012-11-08 01:30:00
2012-11-09 01:30:00
2012-11-010 01:30:00
for i in 0..((@leafe.enddate - @leafe.startdate).to_i)
@attendance = Attendance.new
@attendance.signin = '2012-11-08 01:30:00' #value must change automatically
@attendance.signout = '2012-11-08 10:30:00'#value must change automatically
@attendance.user_id = @leafe.user_id
@attendance.save
end
的回答我说感谢
不要为完全相同的问题创建新帖子。编辑你的旧的。 – sunnyrjuneja
我们可以合并吗? – aef