annikoff / redmine_plugin_computed_custom_field

Computed Custom Field for Redmine
https://www.redmine.org/plugins/computed_custom_field
MIT License
81 stars 52 forks source link

Include other libraries #142

Closed Odko closed 6 years ago

Odko commented 6 years ago

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

annikoff commented 6 years ago

Add gems to your Gemfile and run bundle install command.

gem 'business_time'
gem 'holiday'
Odko commented 6 years ago

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

annikoff commented 6 years ago

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