Module: EcircleTimeHelper

Defined in:
lib/ecircle_soap_client.rb

Overview

Helper for converting times to ecircle expected format.

Instance Method Summary collapse

Instance Method Details

#ecircle_format(prefix) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/ecircle_soap_client.rb', line 18

def ecircle_format(prefix)
  # ecircle uses JS month indices
  strftime("yyyy:%Y,dd:%d,hh:%H,min:%M,ss:%S,mm:#{'%02d' % (month - 1)}").split(',').
    inject({}) do |hsh, postfix_and_value|
    postfix, value = postfix_and_value.split(':')
    hsh.merge( "#{prefix}_#{postfix}".to_sym => value )
  end
end