Bug on Format date
This commit is contained in:
@@ -17,7 +17,7 @@ type Booking struct {
|
||||
DatacenterResourceID string `json:"datacenter_resource_id,omitempty" bson:"datacenter_resource_id,omitempty" validate:"required"`
|
||||
}
|
||||
|
||||
func (wfa *Booking) CheckBooking(start time.Time, end *time.Time) (bool, error) {
|
||||
func (wfa *Booking) CheckBooking(id string, start time.Time, end *time.Time) (bool, error) {
|
||||
// check if
|
||||
if end == nil {
|
||||
// if no end... then Book like a savage
|
||||
@@ -27,6 +27,7 @@ func (wfa *Booking) CheckBooking(start time.Time, end *time.Time) (bool, error)
|
||||
accessor := wfa.GetAccessor(nil)
|
||||
res, code, err := accessor.Search(&dbs.Filters{
|
||||
And: map[string][]dbs.Filter{
|
||||
"datacenter_resource_id": {{Operator: dbs.EQUAL.String(), Value: id}},
|
||||
"workflowexecution.state": {{Operator: dbs.EQUAL.String(), Value: workflow_execution.SCHEDULED.EnumIndex()}},
|
||||
"workflowexecution.execution_date": {
|
||||
{Operator: dbs.LTE.String(), Value: primitive.NewDateTimeFromTime(e)},
|
||||
|
Reference in New Issue
Block a user