Skip to content

Commit

Permalink
Version 1.0.0-alpha-5
Browse files Browse the repository at this point in the history
  • Loading branch information
hirishu10 committed Mar 15, 2022
0 parents commit dc9e2ca
Show file tree
Hide file tree
Showing 10 changed files with 953 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules/
package-lock
tsconfig
yarn.lock

.expo/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# macOS
.DS_Store
17 changes: 17 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules/
package-lock
tsconfig
yarn.lock

.expo/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# macOS
.DS_Store
208 changes: 208 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
# @hirishu10/simple-date-time · ![Version](https://img.shields.io/npm/v/@hirishu10/simple-date-time?label=version) <a href="https://img.shields.io/npm/l/react-native">![License](https://img.shields.io/npm/l/@hirishu10/simple-date-time)</a> <a href="https://img.shields.io/readthedocs/react">![Downloads](https://img.shields.io/npm/dw/@hirishu10/simple-date-time)</a> <a href="https://img.shields.io/badge/Github-hirishu10-lightgrey">![DocsPassing](https://img.shields.io/badge/Github-hirishu10-lightgrey)</a>

<!-- -->

Simple and very helpful package to get the Date Time functionality.

Now everyone can create full fletched `Clock` and `Date` `Time` service using this package hope you like this Thank You 🙂

<!-- Contents -->

# Content

- [Getting started](#getting-started)
- [Overview](#overview)
- [Method and Props Configuration](#method-and-props-configuration)
- [Author](#author)
- [License](#license)
<!-- Contents -->

<!-- Getting Started -->

## Prerequisites

- Node (version 16 or greater).
- Yarn (version 1.5 or greater).
- A fork of the repo (for any contributions).
- Please read the docs carefully Thanks

## Installation

> Using NPM
```bash
npm i @hirishu10/simple-date-time
```

> Using Yarn
```bash
yarn add @hirishu10/simple-date-time
```

# Getting started

##### Simple and Customized Date-Time Functionality

```javaScript
import {
getCustomDayNameFull,
getCustomDayNameShort,
getCustomMonthNameFull,
getCustomMonthNameShort,
getCustomDate,
getCustomHour,
getCustomMinute,
getCustomSecond,
getCustomAmPm,
getCustomFullDateAndTimeWithAmPm,
getCustomFullDateAndTimeWithAmPmIncludingSeconds
} from "@hirishu10/simple-date-time";
```

```javaScript
const fullDay = getCustomDayNameFull();
const shortDay = getCustomDayNameShort();
const fullMonth = getCustomMonthNameFull();
const shortMonth = getCustomMonthNameShort();
const toDate = getCustomDate();
const hour = getCustomHour();
const minute = getCustomMinute();
const second = getCustomSecond();
const amPm = getCustomAmPm();
const timestampLower = getCustomFullDateAndTimeWithAmPm();
const timestampwithSeconds = getCustomFullDateAndTimeWithAmPmIncludingSeconds();
```

##### Done 🙂 you don't need to write any further code to get the Date-Time Functionality just calling the simple function and you can good to go

<!-- Getting Started -->

<!-- overview -->

# Overview

#### 📖 Below we provide examples with code how to use!

- getCustomDayNameFull();

```javaScript
const fullDay = getCustomDayNameFull();
Output: Friday
```

- getCustomDayNameShort();

```javaScript
const shortDay = getCustomDayNameShort();
Output: Fri
```

- getCustomMonthNameFull();

```javaScript
const fullMonth = getCustomMonthNameFull();
Output: October
```

- getCustomMonthNameShort();

```javaScript
const shortMonth = getCustomMonthNameShort();
Output: Oct
```

- getCustomDate();

```javaScript
const toDate = getCustomDate();
Output: 10 // todate
```

- getCustomHour();

```javaScript
const hour = getCustomHour();
Output: 10 // current hour
```

- getCustomMinute();

```javaScript
const minute = getCustomMinute();
Output: 10 // current minute
```

- getCustomSecond();

```javaScript
const second = getCustomSecond();
Output: 10 // current seconds
```

- getCustomAmPm();

```javaScript
const amPm = getCustomAmPm();
Output: am/pm
```

- getCustomFullDateAndTimeWithAmPm();

```javaScript
const timestampLower = getCustomFullDateAndTimeWithAmPm();
```

```bash
Output: 10 October Friday 10:00am
```

- getCustomFullDateAndTimeWithAmPmIncludingSeconds();

```javaScript
const timestampwithSeconds = getCustomFullDateAndTimeWithAmPmIncludingSeconds();
```

```bash
Output: 10 October Friday 10:00:00am
```

<!-- -->

# Method and Props Configuration

🔧 Below are the props which you can use to customized the date-time style

| Method | Type | Description |
| :------------------- | :-----: | :----------------------------------------------------------------------------------------------- |
| `capsOnFlag` | boolean | By default False If Provide True then return the String in UpperCase else in LowerCase |
| `properCaseFlag` | boolean | By default True Providing this the String will return in Proper structure else all in lower case |
| `changeToStringFlag` | boolean | Totally Optional if you need in String make true the flag else ignore |
| `shortOrFullFlag` | boolean | By Default False which return the Day, Month in Short else Make True to return in Full |
| `lowerOrUpperFlag` | boolean | By Default False which return the Day, Month in lowerCase else Make True to return in UpperCase |

<!-- method and props -->

<!-- author -->

# Author

#### Thank You All 🙏🏻

Made with 🖤 by

**Author** : [Rishu Chowdhary](https://github.com/hirishu10)

**Email** : [email protected]

<!-- author -->

<!-- licesnce -->

# License

#### MIT License 📄

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/hirishu10/react-native-customized-box/blob/main/LICENSE) file for details

<!-- licesnce -->
73 changes: 73 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
*
* @param capsOnFlag By default False | If Provide True then return the String in UpperCase else in LowerCase
* @param properCaseFlag By default True | Providing this the String will return in Proper structure
* @returns - `String`
*/
export declare const getCustomDayNameFull: (capsOnFlag?: boolean | undefined | null, properCaseFlag?: boolean | undefined | null) => "SUNDAY" | "Sunday" | "sunday" | "MONDAY" | "Monday" | "monday" | "TUESDAY" | "Tuesday" | "tuesday" | "WEDNESDAY" | "Wednesday" | "wednesday" | "THURSDAY" | "Thursday" | "thursday" | "FRIDAY" | "Friday" | "friday" | "SATURDAY" | "Saturday" | "saturday" | null;
/**
*
* @param capsOnFlag By default False | If Provide True then return the String in UpperCase else in LowerCase
* @param properCaseFlag By default True | Providing this the String will return in Proper structure
* @returns - `String`
*/
export declare const getCustomDayNameShort: (capsOnFlag?: boolean | undefined | null, properCaseFlag?: boolean | undefined | null) => "SUN" | "Sun" | "sun" | "MON" | "Mon" | "mon" | "TUE" | "Tue" | "tue" | "WED" | "Wed" | "wed" | "THU" | "Thu" | "thu" | "FRI" | "Fri" | "fri" | "SAT" | "Sat" | "sat" | null;
/**
*
* @param capsOnFlag By default False | If Provide True then return the String in UpperCase else in LowerCase
* @param properCaseFlag By default True | Providing this the String will return in Proper structure
* @returns - `String`
*/
export declare const getCustomMonthNameFull: (capsOnFlag?: boolean | undefined | null, properCaseFlag?: boolean | undefined | null) => "JANUARY" | "January" | "january" | "FEBRUARY" | "February" | "february" | "MARCH" | "March" | "march" | "APRIL" | "April" | "april" | "MAY" | "May" | "may" | "JUNE" | "June" | "june" | "JULY" | "July" | "july" | "AUGUST" | "August" | "august" | "SEPTEMBER" | "September" | "september" | "OCTOBER" | "October" | "october" | "NOVEMBER" | "November" | "november" | "DECEMBER" | "December" | "december" | null;
/**
*
* @param capsOnFlag By default False | If Provide True then return the String in UpperCase else in LowerCase
* @param properCaseFlag By default True | Providing this the String will return in Proper structure
* @returns - `String`
*/
export declare const getCustomMonthNameShort: (capsOnFlag?: boolean | undefined | null, properCaseFlag?: boolean | undefined | null) => "MAY" | "May" | "may" | "JAN" | "Jan" | "jan" | "FEB" | "Feb" | "feb" | "MAR" | "Mar" | "mar" | "APR" | "Apr" | "apr" | "JUN" | "Jun" | "jun" | "JUL" | "Jul" | "jul" | "AUG" | "Aug" | "aug" | "SEP" | "Sep" | "sep" | "OCT" | "Oct" | "oct" | "NOV" | "Nov" | "nov" | "DEC" | "Dec" | "dec" | null;
/**
*
* @param changeToStringFlag Totally Optional if you need in String make true the flag else ignore
* @returns Today Date from (1 - 30 or 1 - 31) <= Default `Number` else you can change to `String`
*/
export declare const getCustomDate: (changeToStringFlag?: boolean | undefined | null) => string | number | null;
/**
*
* @param changeToStringFlag Totally Optional if you need in String make true the flag else ignore
* @returns Current hour in number (1 - 12) <= Default `Number` else you can change to `String`
*/
export declare const getCustomHour: (changeToStringFlag?: boolean | undefined | null) => string | number | null;
/**
*
* @param changeToStringFlag Totally Optional if you need in String make true the flag else ignore
* @returns Current minute in number (1 - 60) <= Default `Number` else you can change to `String`
*/
export declare const getCustomMinute: (changeToStringFlag?: boolean | undefined | null) => string | number | null;
/**
*
* @param changeToStringFlag Totally Optional if you need in String make true the flag else ignore
* @returns Current minute in number (1 - 60) <= Default `Number` else you can change to `String`
*/
export declare const getCustomSecond: (changeToStringFlag?: boolean | undefined | null) => string | number | null;
/**
*
* @param capsOnFlag By default False | If Provide True then return the String in UpperCase else in LowerCase
* @returns `String` (Check `capsOnFlag` to return like AM or am | PM or pm)
*/
export declare const getCustomAmPm: (capsOnFlag: boolean | undefined | null) => string | null;
/**
*
* @param shortOrFullFlag By Default False which return the Day, Month in Short else Make True to return in Full
* @param lowerOrUpperFlag By Default False which return the Day, Month in lowerCase else Make True to return in UpperCase
* @returns The Full TimeStamp in `String` --> ( 10 OCT TUE 10:10AM - 10 Oct Tue 10:10am ) | ( 10 OCTOBER TUESDAY 10:10AM - 10 October Tuesday 10:10am )
*/
export declare const getCustomFullDateAndTimeWithAmPm: (shortOrFullFlag?: boolean | undefined, lowerOrUpperFlag?: boolean | undefined) => string | null;
/**
*
* @param shortOrFullFlag By Default False which return the Day, Month in Short else Make True to return in Full
* @param lowerOrUpperFlag By Default False which return the Day, Month in lowerCase else Make True to return in UpperCase
* @returns The Full TimeStamp in `String` --> ( 10 OCT TUE 10:10:00AM - 10 Oct Tue 10:10:00am ) | ( 10 OCTOBER TUESDAY 10:10:00AM - 10 October Tuesday 10:10:00am )
*/
export declare const getCustomFullDateAndTimeWithAmPmIncludingSeconds: (shortOrFullFlag?: boolean | undefined, lowerOrUpperFlag?: boolean | undefined) => string | null;
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dc9e2ca

Please sign in to comment.