1.0.6 • Published 5 years ago

honeycombbe-select-time v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

###Install

npm i honeycombbe-select-time

####Use Case This package helps to format time ranges for a specified date. Useful for some calendaring applications, but primary used to generate time slots for users to pick from a drop-down (select) menu.

####Setup 

import * as selectTime from 'honeycombbe-select-time';
/*
OR
*/
const selectTime = require('honeycombbe-select-time');
var config = {
	start: '8:00AM', //Start time in h:mma format
	end: '8:00PM', // End time in h:mma format
	date: '2019-12-01', // Date the slots are built upon in YYYY-MM-DD format
	interval: 15, //Slots interval in minutes
	timezone: 'America/Chicago'
};

selectTime.init(config);
console.log(selectTime.slots());

####Returns

	[
		{
			display: '08:00AM',
			timestamp: 1575208800
		},
		{
			display: '08:15AM',
			timestamp: 1575209700
		}
		...
	]
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago