trabajo-afectivo/lib/import/otrs/dynamic_field/date_time.rb
2022-01-01 14:38:12 +01:00

21 lines
631 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
module Import
module OTRS
class DynamicField
class DateTime < Import::OTRS::DynamicField
def init_callback(dynamic_field)
@attribute_config.merge!(
data_type: 'datetime',
data_option: {
future: dynamic_field['Config']['YearsInFuture'] != '0',
past: dynamic_field['Config']['YearsInPast'] != '0',
diff: dynamic_field['Config']['DefaultValue'].to_i / 60 / 60,
null: true,
}
)
end
end
end
end
end