@theholocron/date-time-utils 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +21 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,28 @@
1
- # Date & Time
1
+ # `@theholocron/date-time-utils`
2
2
 
3
- Handle dates and time.
3
+ Date and time utilities.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install --save-dev @theholocron/utils-date-time
8
+ pnpm add @theholocron/date-time-utils
9
9
  ```
10
10
 
11
- Check out [The Holocron Archive](https://docs.theholocron.dev/projects/utilities/) for more information.
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { getTimeOfDay } from "@theholocron/date-time-utils";
15
+
16
+ getTimeOfDay(); // uses current time
17
+ getTimeOfDay(new Date("2024-01-01 08:00")); // "morning"
18
+ getTimeOfDay(new Date("2024-01-01 14:00")); // "afternoon"
19
+ getTimeOfDay(new Date("2024-01-01 20:00")); // "evening"
20
+ ```
21
+
22
+ ### `getTimeOfDay(date?)`
23
+
24
+ Returns `"morning"` (midnight–10:59), `"afternoon"` (11:00–17:59), or `"evening"` (18:00+). Defaults to the current time when no date is passed.
25
+
26
+ ## Documentation
27
+
28
+ Check out [The Holocron Archive](https://docs.theholocron.dev/projects/utils/) for more information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/date-time-utils",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Handle dates and time.",
5
5
  "homepage": "https://github.com/theholocron/utils/tree/main/packages/utils-date-time#readme",
6
6
  "bugs": "https://github.com/theholocron/utils/issues",