annikoff/redmine_plugin_computed_custom_field

Include other libraries

Odko opened this issue · 3 comments

Odko commented

Is it possible to include libraries in formula like require 'business_time' ?

I'd like to include business_time and holiday gems and use them to calculate business days between dates.

Thank you

Add gems to your Gemfile and run bundle install command.

gem 'business_time'
gem 'holiday'
Odko commented

Thanks for quick reply.
Installed, but how can i use that ?
Tried :
1.

require 'business_time'
1.business_hour.ago

The error says:
Formula cannot load such file -- business_time

  1. and also tried without require 'business_time'

1.business_hour.ago

The error says:
Formula undefined method 'business_hour' for 1:Fixnum

I think it is more about redmine itself, try to find the answer in an official forum.