Giter VIP home page Giter VIP logo

time_dropdown's Introduction

time_dropdown

A simple #time_dropdown element for the Nitrogen Web Framework

Installing into a Nitrogen Application

Add it as a rebar dependency by adding into the deps section of rebar.config:

	{time_dropdown, "", {git, "git://github.com/choptastic/time_dropdown.git", {branch, master}}}

Using Nitrogen's built-in plugin installer (Requires Nitrogen 2.2.0)

Run make in your Application. The rest should be automatic.

Manual Installation (Nitrogen Pre-2.2.0)

Run the following at the command line:

	./rebar get-deps
	./rebar compile

Then add the following includes into any module requiring the form

	-include_lib("time_dropdown/include/records.hrl").

Usage

	#time_dropdown{
		from="8am",
		to="5pm",
		interval=15,
		interval_type=minutes,
		format="g:i:sa",
		value="9:00am"
	}
  • from: The first time in the dropdown (Default: "12:00am")
  • to: The last time in the dropdown (Default: "11:59am")
  • value: The selected value in the dropdown. This time is intelligently compared, so that "9am" == "9:00"
  • interval_type: The granularity of interval (seconds, minutes, hours) (Default: minutes)
  • interval: How many interval_types for each interval. (Default: 60)
  • format: The format to render each time. (Default: "g:ia")

Note

Internally, this just uses qdate's range/4 function

License

Copyright (c) 2016, Jesse Gumm (@jessegumm)

MIT License

time_dropdown's People

Contributors

choptastic avatar

Watchers

 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.