to_timezone 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +8 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.txt +21 -0
- data/README.md +182 -0
- data/Rakefile +12 -0
- data/lib/to_timezone/tz_ext.rb +30 -0
- data/lib/to_timezone/tzs.rb +155 -0
- data/lib/to_timezone/version.rb +5 -0
- data/lib/to_timezone.rb +9 -0
- data/sig/to_timezone.rbs +4 -0
- metadata +100 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4b61826d74eb0083674327756d95295bc161023be436f261eeefdc0770351926
|
4
|
+
data.tar.gz: 0ac898231d41be8a49890a75344c761b8defbf35612b2202f50658baf607176c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1b083b0f847162cb5cebdb7013191c671f267c7b4dcc8466340db5e0a4653a8cdb18056d28b4c92e63775f3e0bb7bb4d53c49c7bc07cb3cab3687203165d4f6f
|
7
|
+
data.tar.gz: 5bb119368668487b2a3364aefcc9d50adc08af020244a89651e6625d5731c94e5ea772b9fde1cd1e414167f3136f4b8b367a416bf570303e47494f58a61c9498
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
10
|
+
identity and orientation.
|
11
|
+
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
14
|
+
|
15
|
+
## Our Standards
|
16
|
+
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
19
|
+
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
26
|
+
community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
31
|
+
any kind
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
* Public or private harassment
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
35
|
+
without their explicit permission
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
37
|
+
professional setting
|
38
|
+
|
39
|
+
## Enforcement Responsibilities
|
40
|
+
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
45
|
+
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
50
|
+
|
51
|
+
## Scope
|
52
|
+
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official email address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
58
|
+
|
59
|
+
## Enforcement
|
60
|
+
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
[INSERT CONTACT METHOD].
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
82
|
+
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
86
|
+
actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
93
|
+
ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
113
|
+
community.
|
114
|
+
|
115
|
+
## Attribution
|
116
|
+
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.1, available at
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by
|
122
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
123
|
+
|
124
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
125
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
126
|
+
[https://www.contributor-covenant.org/translations][translations].
|
127
|
+
|
128
|
+
[homepage]: https://www.contributor-covenant.org
|
129
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
130
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
131
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
132
|
+
[translations]: https://www.contributor-covenant.org/translations
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2025 Nujian Den Mark Meralpis
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
# ToTimezone
|
2
|
+
|
3
|
+
Easily convert Time and DateTime objects to different time zones using intuitive methods like `.to_pht`, `.to_ict`, and more.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'to_timezone'
|
11
|
+
```
|
12
|
+
|
13
|
+
Then execute:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
```bash
|
22
|
+
gem install to_timezone
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
This gem allows you to call methods like `to_utc`, `to_pht`, and others to convert `Time` and `DateTime` objects to different time zones.
|
28
|
+
|
29
|
+
### Example:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
# Current time in your local timezone
|
33
|
+
current_time = Time.now
|
34
|
+
|
35
|
+
# Convert to a specific timezone (e.g., Manila)
|
36
|
+
manila_time = current_time.to_pht # => Asia/Manila time zone
|
37
|
+
|
38
|
+
puts manila_time # => 2025-02-07 10:53:47.355858000 PST +08:00
|
39
|
+
```
|
40
|
+
|
41
|
+
### Supported Timezones:
|
42
|
+
|
43
|
+
| Method | Timezone Name |
|
44
|
+
| ----------------- | ------------------------------ |
|
45
|
+
| `to_idlw` | Etc/GMT+12 |
|
46
|
+
| `to_utc` | Etc/UTC |
|
47
|
+
| `to_mit` | Pacific/Midway |
|
48
|
+
| `to_sst_sam` | Pacific/Apia |
|
49
|
+
| `to_sst` | Pacific/Pago_Pago |
|
50
|
+
| `to_hst` | Pacific/Honolulu |
|
51
|
+
| `to_akst` | America/Juneau |
|
52
|
+
| `to_pst` | America/Los_Angeles |
|
53
|
+
| `to_pst_tj` | America/Tijuana |
|
54
|
+
| `to_mst` | America/Denver |
|
55
|
+
| `to_mst_az` | America/Phoenix |
|
56
|
+
| `to_cst` | America/Chicago |
|
57
|
+
| `to_cst_sk` | America/Regina |
|
58
|
+
| `to_cst_gdl` | America/Mexico_City |
|
59
|
+
| `to_cst_mt` | America/Monterrey |
|
60
|
+
| `to_cst_ca` | America/Guatemala |
|
61
|
+
| `to_est` | America/New_York |
|
62
|
+
| `to_est_in` | America/Indiana/Indianapolis |
|
63
|
+
| `to_est_bg` | America/Bogota |
|
64
|
+
| `to_est_lm` | America/Lima |
|
65
|
+
| `to_ast` | America/Halifax |
|
66
|
+
| `to_ast_pr` | America/Puerto_Rico |
|
67
|
+
| `to_vet` | America/Caracas |
|
68
|
+
| `to_bot` | America/La_Paz |
|
69
|
+
| `to_clt` | America/Santiago |
|
70
|
+
| `to_nst` | America/St_Johns |
|
71
|
+
| `to_brt` | America/Sao_Paulo |
|
72
|
+
| `to_art` | America/Argentina/Buenos_Aires |
|
73
|
+
| `to_uyt` | America/Montevideo |
|
74
|
+
| `to_gyt` | America/Guyana |
|
75
|
+
| `to_wgt` | America/Godthab |
|
76
|
+
| `to_mia` | Atlantic/South_Georgia |
|
77
|
+
| `to_azt` | Atlantic/Azores |
|
78
|
+
| `to_cvt` | Atlantic/Cape_Verde |
|
79
|
+
| `to_gmt` | Europe/Dublin |
|
80
|
+
| `to_gmt_lon` | Europe/London |
|
81
|
+
| `to_wet` | Europe/Lisbon |
|
82
|
+
| `to_cet` | Africa/Casablanca |
|
83
|
+
| `to_gmt_lbr` | Africa/Monrovia |
|
84
|
+
| `to_cet_bg` | Europe/Belgrade |
|
85
|
+
| `to_cet_bs` | Europe/Bratislava |
|
86
|
+
| `to_cet_bd` | Europe/Budapest |
|
87
|
+
| `to_cet_lj` | Europe/Ljubljana |
|
88
|
+
| `to_cet_pg` | Europe/Prague |
|
89
|
+
| `to_cet_sv` | Europe/Sarajevo |
|
90
|
+
| `to_cet_sk` | Europe/Skopje |
|
91
|
+
| `to_cet_wz` | Europe/Warsaw |
|
92
|
+
| `to_cet_zg` | Europe/Zagreb |
|
93
|
+
| `to_cet_brussels` | Europe/Brussels |
|
94
|
+
| `to_cet_cp` | Europe/Copenhagen |
|
95
|
+
| `to_cet_md` | Europe/Madrid |
|
96
|
+
| `to_cet_pr` | Europe/Paris |
|
97
|
+
| `to_cet_am` | Europe/Amsterdam |
|
98
|
+
| `to_cet_br2` | Europe/Berlin |
|
99
|
+
| `to_cet_zr` | Europe/Zurich |
|
100
|
+
| `to_cet_ro` | Europe/Rome |
|
101
|
+
| `to_cet_st` | Europe/Stockholm |
|
102
|
+
| `to_cet_vn` | Europe/Vienna |
|
103
|
+
| `to_cet_wa` | Africa/Algiers |
|
104
|
+
| `to_eet` | Europe/Bucharest |
|
105
|
+
| `to_eet_cai` | Africa/Cairo |
|
106
|
+
| `to_eet_hls` | Europe/Helsinki |
|
107
|
+
| `to_eet_kv` | Europe/Kiev |
|
108
|
+
| `to_eet_ri` | Europe/Riga |
|
109
|
+
| `to_eet_sf` | Europe/Sofia |
|
110
|
+
| `to_eet_tl` | Europe/Tallinn |
|
111
|
+
| `to_eet_vi` | Europe/Vilnius |
|
112
|
+
| `to_eet_at` | Europe/Athens |
|
113
|
+
| `to_eet_is` | Europe/Istanbul |
|
114
|
+
| `to_fet` | Europe/Minsk |
|
115
|
+
| `to_idt` | Asia/Jerusalem |
|
116
|
+
| `to_cat` | Africa/Harare |
|
117
|
+
| `to_sast` | Africa/Johannesburg |
|
118
|
+
| `to_usz1` | Europe/Kaliningrad |
|
119
|
+
| `to_msk` | Europe/Moscow |
|
120
|
+
| `to_vlg` | Europe/Volgograd |
|
121
|
+
| `to_sam` | Europe/Samara |
|
122
|
+
| `to_ast_kw` | Asia/Kuwait |
|
123
|
+
| `to_ast_ry` | Asia/Riyadh |
|
124
|
+
| `to_eat` | Africa/Nairobi |
|
125
|
+
| `to_ast_bd` | Asia/Baghdad |
|
126
|
+
| `to_irst` | Asia/Tehran |
|
127
|
+
| `to_gst` | Asia/Muscat |
|
128
|
+
| `to_azt_baku` | Asia/Baku |
|
129
|
+
| `to_get` | Asia/Tbilisi |
|
130
|
+
| `to_amt` | Asia/Yerevan |
|
131
|
+
| `to_aft` | Asia/Kabul |
|
132
|
+
| `to_yekt` | Asia/Yekaterinburg |
|
133
|
+
| `to_pkt` | Asia/Karachi |
|
134
|
+
| `to_uzt` | Asia/Tashkent |
|
135
|
+
| `to_ist` | Asia/Kolkata |
|
136
|
+
| `to_npt` | Asia/Kathmandu |
|
137
|
+
| `to_bst` | Asia/Dhaka |
|
138
|
+
| `to_lkt` | Asia/Colombo |
|
139
|
+
| `to_almt` | Asia/Almaty |
|
140
|
+
| `to_novt` | Asia/Novosibirsk |
|
141
|
+
| `to_burm` | Asia/Rangoon |
|
142
|
+
| `to_ict` | Asia/Bangkok |
|
143
|
+
| `to_wib` | Asia/Jakarta |
|
144
|
+
| `to_krat` | Asia/Krasnoyarsk |
|
145
|
+
| `to_cst_cn` | Asia/Shanghai |
|
146
|
+
| `to_hkt` | Asia/Hong_Kong |
|
147
|
+
| `to_xin` | Asia/Urumqi |
|
148
|
+
| `to_myt` | Asia/Kuala_Lumpur |
|
149
|
+
| `to_sgt` | Asia/Singapore |
|
150
|
+
| `to_cst_tpe` | Asia/Taipei |
|
151
|
+
| `to_awst` | Australia/Perth |
|
152
|
+
| `to_irkt` | Asia/Irkutsk |
|
153
|
+
| `to_ulat` | Asia/Ulaanbaatar |
|
154
|
+
| `to_kst` | Asia/Seoul |
|
155
|
+
| `to_jst` | Asia/Tokyo |
|
156
|
+
| `to_yakt` | Asia/Yakutsk |
|
157
|
+
| `to_acst` | Australia/Darwin |
|
158
|
+
| `to_acdt` | Australia/Adelaide |
|
159
|
+
| `to_aedt` | Australia/Canberra |
|
160
|
+
| `to_aest` | Australia/Melbourne |
|
161
|
+
| `to_aest_syd` | Australia/Sydney |
|
162
|
+
| `to_aest_bne` | Australia/Brisbane |
|
163
|
+
| `to_aet` | Australia/Hobart |
|
164
|
+
| `to_pht` | Asia/Manila |
|
165
|
+
|
166
|
+
## Development
|
167
|
+
|
168
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
169
|
+
|
170
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
171
|
+
|
172
|
+
## Contributing
|
173
|
+
|
174
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/to_timezone. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/denmarkmeralpis/to_timezone/blob/main/CODE_OF_CONDUCT.md).
|
175
|
+
|
176
|
+
## License
|
177
|
+
|
178
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
179
|
+
|
180
|
+
## Code of Conduct
|
181
|
+
|
182
|
+
Everyone interacting in the ToTimezone project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/to_timezone/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'tzs'
|
4
|
+
require 'active_support/core_ext/time'
|
5
|
+
|
6
|
+
module ToTimezone
|
7
|
+
module TzExt
|
8
|
+
ToTimezone::Tzs::TIMEZONES.each do |abbr, timezone|
|
9
|
+
define_method("to_#{abbr}") do
|
10
|
+
self.utc.in_time_zone(timezone)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# Extend Time and DateTime
|
17
|
+
class Time
|
18
|
+
include ToTimezone::TzExt
|
19
|
+
end
|
20
|
+
|
21
|
+
class DateTime
|
22
|
+
include ToTimezone::TzExt
|
23
|
+
end
|
24
|
+
|
25
|
+
# Explicitly patch ActiveSupport::TimeWithZone
|
26
|
+
if defined?(ActiveSupport::TimeWithZone)
|
27
|
+
class ActiveSupport::TimeWithZone
|
28
|
+
include ToTimezone::TzExt
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,155 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ToTimezone
|
4
|
+
class Tzs
|
5
|
+
TIMEZONES = {
|
6
|
+
idlw: 'Etc/GMT+12',
|
7
|
+
mit: 'Pacific/Midway',
|
8
|
+
sst_sam: 'Pacific/Apia',
|
9
|
+
sst: 'Pacific/Pago_Pago',
|
10
|
+
hst: 'Pacific/Honolulu',
|
11
|
+
akst: 'America/Juneau',
|
12
|
+
pst: 'America/Los_Angeles',
|
13
|
+
pst_tj: 'America/Tijuana',
|
14
|
+
mst: 'America/Denver',
|
15
|
+
mst_az: 'America/Phoenix',
|
16
|
+
cst: 'America/Chicago',
|
17
|
+
cst_sk: 'America/Regina',
|
18
|
+
cst_mc: 'America/Mexico_City',
|
19
|
+
cst_mt: 'America/Monterrey',
|
20
|
+
cst_ca: 'America/Guatemala',
|
21
|
+
est: 'America/New_York',
|
22
|
+
est_in: 'America/Indiana/Indianapolis',
|
23
|
+
est_bg: 'America/Bogota',
|
24
|
+
est_lm: 'America/Lima',
|
25
|
+
ast: 'America/Halifax',
|
26
|
+
vet: 'America/Caracas',
|
27
|
+
bot: 'America/La_Paz',
|
28
|
+
clt: 'America/Santiago',
|
29
|
+
nst: 'America/St_Johns',
|
30
|
+
brt: 'America/Sao_Paulo',
|
31
|
+
art: 'America/Argentina/Buenos_Aires',
|
32
|
+
uyt: 'America/Montevideo',
|
33
|
+
gyt: 'America/Guyana',
|
34
|
+
ast_pr: 'America/Puerto_Rico',
|
35
|
+
wgt: 'America/Godthab',
|
36
|
+
mia: 'Atlantic/South_Georgia',
|
37
|
+
azt: 'Atlantic/Azores',
|
38
|
+
cvt: 'Atlantic/Cape_Verde',
|
39
|
+
gmt: 'Europe/Dublin',
|
40
|
+
gmt_lon: 'Europe/London',
|
41
|
+
wet: 'Europe/Lisbon',
|
42
|
+
cet: 'Africa/Casablanca',
|
43
|
+
gmt_lbr: 'Africa/Monrovia',
|
44
|
+
utc: 'UTC',
|
45
|
+
cet_bg: 'Europe/Belgrade',
|
46
|
+
cet_bs: 'Europe/Bratislava',
|
47
|
+
cet_bd: 'Europe/Budapest',
|
48
|
+
cet_lj: 'Europe/Ljubljana',
|
49
|
+
cet_pg: 'Europe/Prague',
|
50
|
+
cet_sv: 'Europe/Sarajevo',
|
51
|
+
cet_sk: 'Europe/Skopje',
|
52
|
+
cet_wz: 'Europe/Warsaw',
|
53
|
+
cet_zg: 'Europe/Zagreb',
|
54
|
+
cet_brussels: 'Europe/Brussels',
|
55
|
+
cet_cp: 'Europe/Copenhagen',
|
56
|
+
cet_md: 'Europe/Madrid',
|
57
|
+
cet_pr: 'Europe/Paris',
|
58
|
+
cet_am: 'Europe/Amsterdam',
|
59
|
+
cet_br2: 'Europe/Berlin',
|
60
|
+
cet_zr: 'Europe/Zurich',
|
61
|
+
cet_zr_2: 'Europe/Zurich',
|
62
|
+
cet_ro: 'Europe/Rome',
|
63
|
+
cet_st: 'Europe/Stockholm',
|
64
|
+
cet_vn: 'Europe/Vienna',
|
65
|
+
cet_wa: 'Africa/Algiers',
|
66
|
+
eet: 'Europe/Bucharest',
|
67
|
+
eet_cai: 'Africa/Cairo',
|
68
|
+
eet_hls: 'Europe/Helsinki',
|
69
|
+
eet_kv: 'Europe/Kiev',
|
70
|
+
eet_ri: 'Europe/Riga',
|
71
|
+
eet_sf: 'Europe/Sofia',
|
72
|
+
eet_tl: 'Europe/Tallinn',
|
73
|
+
eet_vi: 'Europe/Vilnius',
|
74
|
+
eet_at: 'Europe/Athens',
|
75
|
+
eet_is: 'Europe/Istanbul',
|
76
|
+
fet: 'Europe/Minsk',
|
77
|
+
idt: 'Asia/Jerusalem',
|
78
|
+
cat: 'Africa/Harare',
|
79
|
+
sast: 'Africa/Johannesburg',
|
80
|
+
usz1: 'Europe/Kaliningrad',
|
81
|
+
msk: 'Europe/Moscow',
|
82
|
+
msk_sp: 'Europe/Moscow',
|
83
|
+
vlg: 'Europe/Volgograd',
|
84
|
+
sam: 'Europe/Samara',
|
85
|
+
ast_kw: 'Asia/Kuwait',
|
86
|
+
ast_ry: 'Asia/Riyadh',
|
87
|
+
eat: 'Africa/Nairobi',
|
88
|
+
ast_bd: 'Asia/Baghdad',
|
89
|
+
irst: 'Asia/Tehran',
|
90
|
+
gst: 'Asia/Muscat',
|
91
|
+
gulf: 'Asia/Muscat',
|
92
|
+
azt_baku: 'Asia/Baku',
|
93
|
+
get: 'Asia/Tbilisi',
|
94
|
+
amt: 'Asia/Yerevan',
|
95
|
+
aft: 'Asia/Kabul',
|
96
|
+
yekt: 'Asia/Yekaterinburg',
|
97
|
+
pkt: 'Asia/Karachi',
|
98
|
+
pkt_kr: 'Asia/Karachi',
|
99
|
+
uzt: 'Asia/Tashkent',
|
100
|
+
ist: 'Asia/Kolkata',
|
101
|
+
ist_ko: 'Asia/Kolkata',
|
102
|
+
ist_mum: 'Asia/Kolkata',
|
103
|
+
ist_nd: 'Asia/Kolkata',
|
104
|
+
npt: 'Asia/Kathmandu',
|
105
|
+
bst: 'Asia/Dhaka',
|
106
|
+
lkt: 'Asia/Colombo',
|
107
|
+
almt: 'Asia/Almaty',
|
108
|
+
almt_as: 'Asia/Almaty',
|
109
|
+
novt: 'Asia/Novosibirsk',
|
110
|
+
burm: 'Asia/Rangoon',
|
111
|
+
ict: 'Asia/Bangkok',
|
112
|
+
ict_hn: 'Asia/Bangkok',
|
113
|
+
wib: 'Asia/Jakarta',
|
114
|
+
krat: 'Asia/Krasnoyarsk',
|
115
|
+
cst_cn: 'Asia/Shanghai',
|
116
|
+
cst_cn_cq: 'Asia/Chongqing',
|
117
|
+
hkt: 'Asia/Hong_Kong',
|
118
|
+
xin: 'Asia/Urumqi',
|
119
|
+
myt: 'Asia/Kuala_Lumpur',
|
120
|
+
sgt: 'Asia/Singapore',
|
121
|
+
cst_tpe: 'Asia/Taipei',
|
122
|
+
awst: 'Australia/Perth',
|
123
|
+
irkt: 'Asia/Irkutsk',
|
124
|
+
ulat: 'Asia/Ulaanbaatar',
|
125
|
+
kst: 'Asia/Seoul',
|
126
|
+
jst: 'Asia/Tokyo',
|
127
|
+
jst_sp: 'Asia/Tokyo',
|
128
|
+
jst_tokyo: 'Asia/Tokyo',
|
129
|
+
yakt: 'Asia/Yakutsk',
|
130
|
+
acst: 'Australia/Darwin',
|
131
|
+
acdt: 'Australia/Adelaide',
|
132
|
+
aedt: 'Australia/Canberra',
|
133
|
+
aest: 'Australia/Melbourne',
|
134
|
+
aest_syd: 'Australia/Sydney',
|
135
|
+
aest_bne: 'Australia/Brisbane',
|
136
|
+
aet: 'Australia/Hobart',
|
137
|
+
vlat: 'Asia/Vladivostok',
|
138
|
+
gum: 'Pacific/Guam',
|
139
|
+
pgt: 'Pacific/Port_Moresby',
|
140
|
+
mag: 'Asia/Magadan',
|
141
|
+
sred: 'Asia/Srednekolymsk',
|
142
|
+
gda: 'Pacific/Guadalcanal',
|
143
|
+
nct: 'Pacific/Noumea',
|
144
|
+
fjt: 'Pacific/Fiji',
|
145
|
+
pet: 'Asia/Kamchatka',
|
146
|
+
mht: 'Pacific/Majuro',
|
147
|
+
nzst: 'Pacific/Auckland',
|
148
|
+
nzdt: 'Pacific/Auckland',
|
149
|
+
tot: 'Pacific/Tongatapu',
|
150
|
+
tkl: 'Pacific/Fakaofo',
|
151
|
+
chast: 'Pacific/Chatham',
|
152
|
+
pht: 'Asia/Manila'
|
153
|
+
}.freeze
|
154
|
+
end
|
155
|
+
end
|
data/lib/to_timezone.rb
ADDED
data/sig/to_timezone.rbs
ADDED
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: to_timezone
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nujian Den Mark Meralpis
|
8
|
+
bindir: exe
|
9
|
+
cert_chain: []
|
10
|
+
date: 2025-02-07 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: activesupport
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '6.0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '6.0'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rspec
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: timecop
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
description: Adds intuitive time zone conversion methods to Time and DateTime in Rails,
|
55
|
+
allowing calls like `.to_pht`, `.to_ict`, and more for effortless time zone handling.
|
56
|
+
email:
|
57
|
+
- denmarkmeralpis@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".rspec"
|
63
|
+
- ".rubocop.yml"
|
64
|
+
- CHANGELOG.md
|
65
|
+
- CODE_OF_CONDUCT.md
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- lib/to_timezone.rb
|
70
|
+
- lib/to_timezone/tz_ext.rb
|
71
|
+
- lib/to_timezone/tzs.rb
|
72
|
+
- lib/to_timezone/version.rb
|
73
|
+
- sig/to_timezone.rbs
|
74
|
+
homepage: https://github.com/denmarkmeralpis/to_timezone.git
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
metadata:
|
78
|
+
allowed_push_host: https://rubygems.org
|
79
|
+
homepage_uri: https://github.com/denmarkmeralpis/to_timezone.git
|
80
|
+
source_code_uri: https://github.com/denmarkmeralpis/to_timezone.git
|
81
|
+
changelog_uri: https://github.com/denmarkmeralpis/to_timezone.git
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.5.0
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubygems_version: 3.6.2
|
97
|
+
specification_version: 4
|
98
|
+
summary: Seamlessly convert Time and DateTime objects to different time zones with
|
99
|
+
intuitive methods like `.to_pht`, `.to_ict`, and more.
|
100
|
+
test_files: []
|