hackapp_gem 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 695cdaf80014016045242d1670e16e891d3a1072
4
- data.tar.gz: d22752e84692cc552d29a46bb345c1be9ed91f2b
3
+ metadata.gz: 5fb266edaef31f2e8cae15a0f208a605e243e20a
4
+ data.tar.gz: c5b9a63b45b97f8e5611ec6ca4d9a86f46273004
5
5
  SHA512:
6
- metadata.gz: 7643e2e2d2b3a460b26962ed10bb0726c6fb0a0f462310208757819a8cbaa5863a8545b1647f1c88dea998026e14410008de1d4720a6ecdb918236587629a1cb
7
- data.tar.gz: 392ba622e21f8e49924e84600c017d74a3ad8be2997915dd5113821ba6fa708372cbd11b9ba4d23401015bb8ecdbb1ac915899c16194d5354069989f6819c68f
6
+ metadata.gz: ff5b1bcd9e0d9cc701e4834fabc3e46419c97a7fbab131ef8617f9c408605bdca869989d31ac49992f4b8a9ea1bc63ed2a47b456e5ddf3cf2c52976c267390f1
7
+ data.tar.gz: 8e6130ccf6abe530943c45082bb7b9252885b7e3b4bea3451404094b12f4c6d7bcaeae0cbae26c9ef6d848c727af87342652c34fe018240661c16d939fdb90b1
@@ -1,3 +1,3 @@
1
1
  module HackappGem
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
data/lib/hackapp_gem.rb CHANGED
@@ -3,11 +3,11 @@ require "hackapp_gem/version"
3
3
  module HackappGem
4
4
  class ::Time
5
5
 
6
- # times in database are eastern time to add 5 hours to all
6
+ # assuming all times in database are eastern time
7
7
  def to_UTC
8
8
  begin
9
- shift_to_UTC = 5
10
- self.to_datetime.advance(:hours => shift_to_UTC).to_datetime
9
+ shift_to_UTC = 4
10
+ self.to_datetime.advance(:hours => shift_to_UTC).to_time
11
11
  rescue Exception => e
12
12
  puts "Unrecognizeable timezone: #{e}"
13
13
  end
@@ -15,9 +15,9 @@ module HackappGem
15
15
 
16
16
  # adjust according to what you want to view
17
17
  def change_timezone(options)
18
- zones = {"eastern" => -5,
19
- "central" => -6,
20
- "mountain" => -7,
18
+ zones = {"eastern" => -4,
19
+ "central" => -5,
20
+ "mountain" => -6,
21
21
  "arizona" => -7,
22
22
  "pacific" => -8,
23
23
  "alaska" => -9,
@@ -3,14 +3,15 @@ require 'spec_helper'
3
3
  describe HackappGem do
4
4
 
5
5
  it "converts times to correct UTC using to_UTC" do
6
+ Time.zone = "EST"
6
7
  eastern_time = Time.new()
7
- eastern_time.utc == eastern_time.to_UTC
8
+ expect(eastern_time.to_UTC.strftime("%B %d, %Y @ %I:%M%p")).to eql(eastern_time.utc.strftime("%B %d, %Y @ %I:%M%p"))
8
9
  end
9
10
 
10
11
  it "converts times to specified time zones" do
12
+ Time.zone = "EST"
11
13
  eastern_time = Time.new()
12
- utc_time = eastern_time.utc.to_time
13
- eastern_time == utc_time.change_timezone({new_timezone: "eastern"})
14
+ expect(eastern_time.strftime("%B %d, %Y @ %I:%M%p")).to eql(eastern_time.utc.change_timezone({new_timezone: "eastern"}).strftime("%B %d, %Y @ %I:%M%p"))
14
15
  end
15
16
 
16
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hackapp_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Corletti