date.rb 628 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module Import
  3. module OTRS
  4. class DynamicField
  5. class Date < Import::OTRS::DynamicField
  6. def init_callback(dynamic_field)
  7. @attribute_config.merge!(
  8. data_type: 'date',
  9. data_option: {
  10. future: dynamic_field['Config']['YearsInFuture'] != '0',
  11. past: dynamic_field['Config']['YearsInPast'] != '0',
  12. diff: dynamic_field['Config']['DefaultValue'].to_i / 60 / 60 / 24,
  13. null: true,
  14. }
  15. )
  16. end
  17. end
  18. end
  19. end
  20. end