1.week
和1.weeks
之间是否存在差异?或者它们是同义词吗?
答案 0 :(得分:3)
来自Rails docs:
week()
别名:
weeks
weeks()
返回与提供的周数匹配的Duration实例。
2.weeks # => 2 weeks
别名为:
week
答案 1 :(得分:2)
> 1.week == 1.weeks
=> true
> 42.week == 42.weeks
=> true
, week
仅为an alias。
答案 2 :(得分:1)
他们是同义词:
Private Sub schedulerControl_DeleteAppointmentFormShowing(sender As Object, e As AppointmentFormEventArgs) Handles schedulerControl.DeleteRecurrentAppointmentFormShowing
Dim scheduler As DevExpress.XtraScheduler.SchedulerControl = CType(sender, DevExpress.XtraScheduler.SchedulerControl)
Try
If koneksiDB.State = ConnectionState.Open Then
'proses simpan DB
Dim cmd As New SqlCommand("update Appointments set isdeleted = 1 where UniqueID = @Kode", koneksiDB)
Dim apt As Appointment = schedulerControl.SelectedAppointments(0)
Dim dr As DataRowView = CType(apt.GetSourceObject(schedulerStorage), DataRowView)
Dim id As Integer = Convert.ToInt64(dr("UniqueID"))
cmd.Parameters.AddWithValue("kode", id)
cmd.ExecuteNonQuery()
RefreshDB()
Else
MsgBox("Maaf koneksi dengan database terputus. harap memperbaiki koneksi terlebih dahulu.")
End If
Catch ex As Exception
MsgBox("Maaf, terjadi permasalahan teknis :" & Chr(13) & ex.Message & Chr(13) & Chr(13) & "Silakan catat dan hubungi pihak teknisi bila diperlukan.", MsgBoxStyle.Exclamation)
End Try
End Sub