GithubHelp home page GithubHelp logo

andydean565 / datereact Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 1.52 MB

JavaScript plugin to change to change how your content will display based on the time/day/month or custom dates

JavaScript 49.75% CSS 0.39% HTML 49.86%

datereact's Introduction

dateReact

JavaScript plugin to change to change how your content will display based on the time/day/month or custom dates

attribute

span

the span attribute defines when you want something to change form the normal and you can put in time/day/month/date or a predefined variable date.

react-span="01-03"

type

the type attribute is what you want to happen if the current date is within the span which can be a simple as show or more complex like adding a task to change the look of your website.

below are the current types but any suggestions can be added easily.

  • show
  • hide
  • class
  • text
react-type="class"

data

the data attribute is only needs to be included for the class and text type and will define the class or text you want applied to the div.

react-data="active"

format

type Time Day Month date predefined
between "01-09" "monday-wednesday" "october-december" "01/01/2017-02/04/2017" "[october]"
all "01|02|04|07" "monday|thursday" "july|april|november" "01/03/2017|01/05/2017" "[october]"

examples

this example will add the class active to the span element if the time is between 1am - 3am

<span react-span="01-03" react-type="class" react-data="active">1-3</span>

notes

the time is in 24 hour and is only in hours so you can display it any hour of the day

predefined variables will need to be included in the file so fork the plugin edit the debug with your desired predefined and use gulp to compile the min

the plugin will auto detect the span with you have entered but let me know if you're having issues with a date

future development

  • shortened days and months formats
  • allow users to put dates of the current month (can be done with predefined with some JS added)
  • more complex types โ‹…โ‹…* maybe change depending how long someone has been on your website

datereact's People

Contributors

andydean565 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.