@starasia/date 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.
- package/README.md +83 -0
- package/dist/date.es.js +1943 -0
- package/dist/date.umd.js +365 -0
- package/dist/index.d.ts +2 -0
- package/dist/interfaces.d.ts +116 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# starasia date
|
|
2
|
+
|
|
3
|
+
starasia date is a strict and customizable date component for web development projects, designed for simplicity and adherence to strict design guidelines.
|
|
4
|
+
|
|
5
|
+
## Screenshots
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Package instalation
|
|
10
|
+
|
|
11
|
+
Instal package using pnpm
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @starasia/date
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Instal package using yarn
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
yarn add @starasia/date
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Instal package using npm
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm i @starasia/date
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage/Examples
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
import React from "react";
|
|
33
|
+
import {starasiaDate, IDateRange} from "@starasia/date";
|
|
34
|
+
import ReactDOM from "react-dom/client";
|
|
35
|
+
import {useState} from "react";
|
|
36
|
+
|
|
37
|
+
const App = () => {
|
|
38
|
+
// NOTE! IF YOU WANT TO USE ONLY DATE ,THEN JUST PAST DATE,IN EXAMPLE BELLOW IS dateDays, BUT IF U WANT TO USE DATE RANGE THEN YOU SHOULD PAS DATE RANGE, IN EXAMPLE BLLEO IS dateRange OR PERHAPS YOU WILL GET ERROR,PLEASE FOLLOW THE INSTRUCTURE BELLOW
|
|
39
|
+
const [dateDays, setDateDays] = (useState < IDateRange) | (Date > new Date());
|
|
40
|
+
const [dateRange, setDateRange] =
|
|
41
|
+
(useState < IDateRange) |
|
|
42
|
+
(Date >
|
|
43
|
+
{
|
|
44
|
+
from: new Date(),
|
|
45
|
+
to: new Date(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
style={{
|
|
51
|
+
maxWidth: "300px",
|
|
52
|
+
margin: "100px auto",
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
// DATE RANGE EXAMPLE
|
|
56
|
+
<starasiaDate
|
|
57
|
+
value={dateRange}
|
|
58
|
+
onChange={(e: IDateRange) => setDateRange(e)}
|
|
59
|
+
filter="days"
|
|
60
|
+
rangedDate
|
|
61
|
+
/>
|
|
62
|
+
// DATE
|
|
63
|
+
<starasiaDate
|
|
64
|
+
value={dateDays}
|
|
65
|
+
onChange={(e: DATE) => setDateRange(e)}
|
|
66
|
+
filter="days"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Props
|
|
74
|
+
|
|
75
|
+
#### Props that you can pass to <ToastContainer {...props} />
|
|
76
|
+
|
|
77
|
+
| Prop Name | Value | required |
|
|
78
|
+
| :--------- | :------------------------ | :------- |
|
|
79
|
+
| value | Date | true |
|
|
80
|
+
| onChange | (props: any) => void | true |
|
|
81
|
+
| filter | 'days', 'months', 'years' | true |
|
|
82
|
+
| input | boolean | false |
|
|
83
|
+
| rangedDate | boolean | false |
|