work_calendar 0.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +9 -2
- data/lib/work_calendar.rb +12 -0
- data/lib/work_calendar/version.rb +1 -1
- metadata +4 -4
- data/work_calendar-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4d98f999d5492b9a4c7da0391910e83a3ec1c0597686e921a8bc476bcd4a4db
|
4
|
+
data.tar.gz: 3c1d91955a99e92b4ccbfe5c19d2b5f210e49659668d5ab4dc0ce6e733d07c25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 675a5a17f9c6c2611538b321875cf7e1744de61d0daa8c75d3ab9b7d6d509e3ba389e6dc83d5831cf69ed8fdbdec675556aa5a883befc11dcaca6b0b6b059015
|
7
|
+
data.tar.gz: 8bafacf8d20af90311b8e750f8847a57d7b719785ae6591fc5dc10bbe77a76cc1d89d4d3b6f7f0d1bd21f308bf3927fb85563274568146ded8910667863e58ae
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2019
|
3
|
+
Copyright (c) 2019 Toughbyte Ltd
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -32,10 +32,17 @@ Get next `n`'th workday date relative to specified date; if no `date` parameter
|
|
32
32
|
WorkCalendar.next_workday(n, date)
|
33
33
|
```
|
34
34
|
|
35
|
-
|
35
|
+
Works same way as `next_workday` method, only looking backwards.
|
36
36
|
|
37
37
|
```ruby
|
38
|
-
WorkCalendar.prev_workday(date)
|
38
|
+
WorkCalendar.prev_workday(n, date)
|
39
|
+
```
|
40
|
+
|
41
|
+
Get first/last day since specified date
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
WorkCalendar.first_workday_since(date)
|
45
|
+
WorkCalendar.last_workday_since(date)
|
39
46
|
```
|
40
47
|
|
41
48
|
## License
|
data/lib/work_calendar.rb
CHANGED
@@ -76,6 +76,18 @@ module WorkCalendar
|
|
76
76
|
date
|
77
77
|
end
|
78
78
|
|
79
|
+
def first_workday_since(date = Time.zone.today)
|
80
|
+
return date if workday?(date)
|
81
|
+
|
82
|
+
_next_workday(date)
|
83
|
+
end
|
84
|
+
|
85
|
+
def last_workday_since(date = Time.zone.today)
|
86
|
+
return date if workday?(date)
|
87
|
+
|
88
|
+
_prev_workday(date)
|
89
|
+
end
|
90
|
+
|
79
91
|
private
|
80
92
|
|
81
93
|
def _next_workday(date)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: work_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Korenyushkin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -114,7 +114,6 @@ files:
|
|
114
114
|
- bin/setup
|
115
115
|
- lib/work_calendar.rb
|
116
116
|
- lib/work_calendar/version.rb
|
117
|
-
- work_calendar-0.1.0.gem
|
118
117
|
- work_calendar.gemspec
|
119
118
|
homepage: https://github.com/toughbyte/work_calendar
|
120
119
|
licenses:
|
@@ -137,7 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
136
|
- !ruby/object:Gem::Version
|
138
137
|
version: '0'
|
139
138
|
requirements: []
|
140
|
-
|
139
|
+
rubyforge_project:
|
140
|
+
rubygems_version: 2.7.7
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Workday calculator
|
data/work_calendar-0.1.0.gem
DELETED
Binary file
|