@quenty/time 2.0.1-canary.9c1fd3b.0 → 2.0.2-canary.256.edbbcfc.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.
- package/CHANGELOG.md +9 -1
- package/LICENSE.md +1 -1
- package/README.md +5 -3
- package/package.json +2 -2
- package/src/Shared/Time.lua +18 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [2.0.
|
|
6
|
+
## [2.0.2-canary.256.edbbcfc.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/time@2.0.1...@quenty/time@2.0.2-canary.256.edbbcfc.0) (2022-03-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/time
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.0.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/time@2.0.0...@quenty/time@2.0.1) (2021-12-30)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/time
|
|
9
17
|
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
## Time
|
|
2
2
|
<div align="center">
|
|
3
|
-
<a href="http://quenty.github.io/
|
|
4
|
-
<img src="https://
|
|
3
|
+
<a href="http://quenty.github.io/NevermoreEngine/">
|
|
4
|
+
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/docs.yml/badge.svg" alt="Documentation status" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://discord.gg/mhtGUS8">
|
|
7
|
-
<img src="https://img.shields.io/
|
|
7
|
+
<img src="https://img.shields.io/discord/385151591524597761?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="https://github.com/Quenty/NevermoreEngine/actions">
|
|
10
10
|
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/build.yml/badge.svg" alt="Build and release status" />
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
Library handles time based parsing / operations. Untested. Based off of PHP's time system. Note: This library is out of date, and does not necessarily work. I recommend using os.time()
|
|
15
15
|
|
|
16
|
+
<div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/Time">View docs →</a></div>
|
|
17
|
+
|
|
16
18
|
## Installation
|
|
17
19
|
```
|
|
18
20
|
npm install @quenty/time --save
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/time",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2-canary.256.edbbcfc.0",
|
|
4
4
|
"description": "Library handles time based parsing / operations. Untested. Based off of PHP's time system. Note: This library is out of date, and does not necessarily work. I recommend using os.time()",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "edbbcfc38516772a791d50dc43cd6b304ffc4aff"
|
|
31
31
|
}
|
package/src/Shared/Time.lua
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Library handles time based parsing / operations. Untested. Based off of PHP's time system.
|
|
3
|
+
|
|
4
|
+
:::note
|
|
5
|
+
This library is out of date, and does not necessarily work. I recommend using os.time()
|
|
6
|
+
:::
|
|
7
|
+
|
|
8
|
+
@class Time
|
|
9
|
+
]=]
|
|
4
10
|
|
|
5
11
|
local Time = {}
|
|
6
12
|
|
|
@@ -12,7 +18,11 @@ local DAYS_OF_WEEK = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursda
|
|
|
12
18
|
local DAYS_OF_WEEK_SHORT = {"Sun", "Mon", "Tues", "Weds", "Thurs", "Fri", "Sat"}
|
|
13
19
|
-- luacheck: pop
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
--[=[
|
|
22
|
+
Returns a Days in months table for the given year
|
|
23
|
+
@param year number
|
|
24
|
+
@return { [number]: number }
|
|
25
|
+
]=]
|
|
16
26
|
function Time.getDaysMonthTable(year)
|
|
17
27
|
local copy = {}
|
|
18
28
|
for key, value in pairs(DAYS_IN_MONTH) do
|
|
@@ -151,8 +161,10 @@ function Time.getDayOfTheWeekNameShort(currentTime)
|
|
|
151
161
|
return DAYS_OF_WEEK_SHORT[Time.getDayOfTheWeek(currentTime)]
|
|
152
162
|
end
|
|
153
163
|
|
|
154
|
-
|
|
155
|
-
|
|
164
|
+
--[=[
|
|
165
|
+
@param number number
|
|
166
|
+
@return string (Like 1st, 2nd)
|
|
167
|
+
]=]
|
|
156
168
|
function Time.getOrdinalOfNumber(number)
|
|
157
169
|
local tenRemainder = number % 10
|
|
158
170
|
local hundredRemainder = number % 100
|