Sha256: 4404398fa9761aa3381d9a70ce61620aa4df85dc0348e10e331a75b257c60e1f
Contents?: true
Size: 861 Bytes
Versions: 15
Compression:
Stored size: 861 Bytes
Contents
require 'test_helper' class Kaui::DateHelperTest < ActiveSupport::TestCase include Kaui::DateHelper test 'can parse from string' do assert_equal '2012-07-01', format_date('2012-07-01T12:55:44Z', 'Pacific Time (US & Canada)') end test 'can parse from date' do assert_equal '2012-07-01', format_date(Date.new(2012, 7, 1), 'Pacific Time (US & Canada)') end test 'can remove milliseconds from date time' do assert_equal '2012-07-01T12:55:44', truncate_millis('2012-07-01T12:55:44.611Z') end test 'can get current time depending of time zone' do current_time_fiji = current_time('Pacific/Fiji') utc_offset_fiji_without_saving_time = '+1200' utc_offset_fiji_with_saving_time = '+1300' assert_includes [utc_offset_fiji_with_saving_time,utc_offset_fiji_without_saving_time], current_time_fiji.strftime('%z') end end
Version data entries
15 entries across 15 versions & 1 rubygems