Skip to content

Commit

Permalink
accept binary or string for Timezone (2600hz#6435)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo authored and jamesaimonetti committed Apr 1, 2020
1 parent 17d3b9d commit 4d0a049
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions applications/crossbar/priv/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6943,11 +6943,11 @@
},
"Presence-State": {
"enum": [
"trying",
"online",
"offline",
"early",
"online",
"trying",
"confirmed",
"early",
"terminated"
],
"type": "string"
Expand Down Expand Up @@ -6991,11 +6991,11 @@
},
"Presence-State": {
"enum": [
"trying",
"online",
"offline",
"early",
"online",
"trying",
"confirmed",
"early",
"terminated"
],
"type": "string"
Expand Down Expand Up @@ -7067,11 +7067,11 @@
},
"Presence-State": {
"enum": [
"trying",
"online",
"offline",
"early",
"online",
"trying",
"confirmed",
"early",
"terminated"
],
"type": "string"
Expand Down Expand Up @@ -7115,11 +7115,11 @@
},
"Presence-State": {
"enum": [
"trying",
"online",
"offline",
"early",
"online",
"trying",
"confirmed",
"early",
"terminated"
],
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions core/kazoo_stdlib/src/kz_time.erl
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ adjust_utc_timestamp(_Timestamp, <<"+", _/binary>>) ->
throw({'error', 'invalid_offset'});
adjust_utc_timestamp(_Timestamp, <<"-", _/binary>>) ->
throw({'error', 'invalid_offset'});
adjust_utc_timestamp(Timestamp, <<Timezone/binary>>) when is_integer(Timestamp) ->
try localtime:utc_to_local(calendar:gregorian_seconds_to_datetime(Timestamp), kz_term:to_list(Timezone)) of
adjust_utc_timestamp(Timestamp, Timezone) when is_integer(Timestamp) ->
try localtime:utc_to_local(calendar:gregorian_seconds_to_datetime(Timestamp), Timezone) of
{{_, _, _}, {_, _, _}} = Datetime ->
calendar:datetime_to_gregorian_seconds(Datetime);
[LocalDatetime, _LocalDstDatetime] ->
Expand Down
2 changes: 1 addition & 1 deletion make/deps.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dep_eflame = git https://github.com/slfritchie/eflame 7b0bb1a7e8c8482a59421a3a50
dep_eiconv = git https://github.com/zotonic/eiconv 1.0.0
# used by gen_smtp

dep_erlang_localtime = git https://github.com/2600hz/erlang-localtime
dep_erlang_localtime = git https://github.com/2600hz/erlang-localtime 2600hz
# used by kazoo_documents, teletype, notify, crossbar, callflow

dep_erlazure = git https://github.com/2600hz/erlang-erlazure.git 88e0417251983ab4d8a2a2606c732906eecd5007
Expand Down

0 comments on commit 4d0a049

Please sign in to comment.