https://github.com/nikukyugamer/prekin
Judge whether the target day of month is 'PREMIUM FRIDAY' or not.
https://github.com/nikukyugamer/prekin
date date-format date-format-validator date-formatter date-formatting date-time dates datetime premium-friday rubygem rubygems
Last synced: about 1 month ago
JSON representation
Judge whether the target day of month is 'PREMIUM FRIDAY' or not.
- Host: GitHub
- URL: https://github.com/nikukyugamer/prekin
- Owner: nikukyugamer
- License: mit
- Created: 2019-02-25T09:25:47.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-15T04:35:16.000Z (about 2 months ago)
- Last Synced: 2025-04-21T16:55:59.939Z (about 2 months ago)
- Topics: date, date-format, date-format-validator, date-formatter, date-formatting, date-time, dates, datetime, premium-friday, rubygem, rubygems
- Language: Ruby
- Homepage: https://www.meti.go.jp/policy/mono_info_service/service/premium-friday/index.html
- Size: 157 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://github.com/nikukyugamer/prekin/actions/workflows/config.yml)
# Prekin
## What is Prekin?
### Naming
- `Prekin` means `PREMIUM FRIDAY`
- `kin` means FRIDAY (`kin-yo-bi`) in Japanese
- So `PRE`mium `KIN`-yo-bi is `Prekin`### Webpage
- A webpage by Ministry of Economy, Trade and Industry in Japan
- http://www.meti.go.jp/policy/mono_info_service/service/premium-friday/
- A webpage by Premium Friday Committee
- https://premium-friday.com/## Installation
Add this line to your application's Gemfile:
```ruby
gem 'prekin'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install prekin
## Usage
### 1. require
- `require 'prekin'`### 2. call
#### 2-1. Time class
- `Time.local(2020, 10, 30, 0, 0, 0).prekin? #=> true`#### 2-2. Date class
- `Date.new(2020, 10, 30).prekin? #=> true`#### 2-3. DateTime class
- `DateTime.new(2020, 10, 30, 0, 0, 0, '+09:00').prekin? #=> true`#### 2-4. String class
- `'2020/10/30 00:00:00 +09:00'.prekin? #=> true`#### 2-5. Next Prekin
- `Prekin.next #=> "2020-10-30"`
- `Prekin.next('2023-12-28') #=> "2023-12-29"`
- `Prekin.next('2023-12-29') #=> "2023-12-29"`
- `Prekin.next('2023-12-30') #=> "2024-01-26"`## Note
- This gem overwrites `Time`, `Date`, `DateTime` and `String` class.
- So if you use `Time`, `Date`, `DateTime` and `String` class in your code, you should be careful.## Development
#### 1. bundle install
- `bundle install`#### 2. irb
- `bundle exec irb`#### 3. require
- `require 'prekin'`## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).