npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-estimated-delivery

v1.0.5

Published

React component for estimated delivery with config and holiday options.

Downloads

134

Readme

React Estimated Delivery Component

React component for estimated delivery with business day, delivery day and holiday options configuration.

How it works

  • Next day delivery - If it's not past cut off & tomorrow is a delivery day.
  • Determining estimated delivery date - If a business day has passed, the business day date + the deliveryDayIncrement is a delivery day.

How to use

Install

Installation: npm install react-estimated-delivery

Usage

Import the package into your app:

import { EstimatedDeliveryComponent } from "react-estimated-delivery";

Component Example:

    <EstimatedDeliveryComponent
        businessDays={{
            "monday": true,
            "tuesday": true,
            "wednesday": true,
            "thursday": true,
            "friday": true,
            "saturday": false,
            "sunday": false
        }}
        deliveryDays={{
            "monday": true,
            "tuesday": true,
            "wednesday": true,
            "thursday": false,
            "friday": true,
            "saturday": true,
            "sunday": false
        }}
        cutOffTime={"23:50"} 
        holidays={["07/08/2024", "08/08/2024", "09/08/2024", "10/08/2024", "11/08/2024"]}
        timezone={"Europe/London"}
        dateFormat={"en-GB"}
        enableCountDownTimer={true}
        nextDayDeliveryAvailableText={"Next day delivery available."}
        nextDayDeliveryNotAvailableText={"Next day delivery NOT available."}
        estimatedDeliveryText={"Estimated delivery date:"}
        orderWithinText={"Order within"}
        timerText={{hours: "h", minutes: "m", seconds: "s"}}
        isNextDayAvailable={true}
        deliveryDayIncrement={1}
        showDateRange={true}
        dateRange={2}
        loadingText={"Getting estimate..."}
    >

    <img alt="" src={TheIcon} height={24} width={24}></img>
    
    </EstimatedDeliveryComponent>

Component Options:

- The <EstimatedDeliveryComponent> can accept any element between the opening and closing tag this is to be used for the icon. 

-  `businessDays={{
        "monday": true,
        "tuesday": true,
        "wednesday": true,
        "thursday": true,
        "friday": true,
        "saturday": false,
        "sunday": false
    }}`

    Set which days the business is open.

-   `deliveryDays={{
        "monday": true,
        "tuesday": true,
        "wednesday": true,
        "thursday": false,
        "friday": true,
        "saturday": true,
        "sunday": false
    }}` 

    Set which days delivery is available.

-  `cutOffTime={"12:00"}`
    Cut off time for next day delivery.

-  `holidays={["07/08/2024", "08/08/2024"]}`
    Pass in an array of holidays, dd/mm/yyyy, this is to be used for bank holidays.

-  `timezone={"Europe/London"}`
    Set the timezone to diplay to the customer.

-  `dateFormat={"en-GB"}`
    Used when passing in holidays, the format should match the format of your holidays (dd/mm/yy or mm/dd/yyy).

- `enableCountDownTimer={true}`
    Have the countdown show if next day delivery is available.

- `nextDayDeliveryAvailableText={"Next day delivery available."}`
    Text for next day delivery available.

- `nextDayDeliveryNotAvailableText={"Next day delivery NOT available."}`
    Text for next day delivery not available.

- `estimatedDeliveryText={"Estimated delivery date:"}`
    Text for estimated delivery.

- `timerText={{hours: "h", minutes: "m", seconds: "s"}}`
    Text for timer.

- `orderWithinText={"Order within"}`
    Order within text.

- `isNextDayAvailable={true}`
    Enable next day delivery.

- `deliveryDayIncrement={1}`
    Set how many days to increment by.

- `showDateRange={true}`
    Show date range

- `dateRange={2}`
    Number of days to add to earliest delivery date for a date range.

- `loadingText={"Getting estimate..."}`
    Text to display during estimate load.

Example

Estimated Delivery with timer (Next Day available)

Estimated delivery timer example

Estimated Delivery wthout timer (Next day not available)

Estimated delivery example