Simone-cogno / angular-dayparts

Angular directive for select hours in a week

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angular dayparts

Angular directive for select hours in a week

Code based on this StackOverflow answer

Sample

Install it with Bower or npm

bower install angular-dayparts
npm install angular-dayparts

Include the module in your app

angular.module('myapp', ['angular-dayparts'])

Configure the directive inside the controller

$scope.options = {
    // Reset button
    reset: true, // default false
    
    // Event triggered when selecting a cell
    onChange: function(selected) {
        console.log('selected: ', selected)
    },
    
    // Prepopulated cells.  When contents of selected changes the day parts will update correspondingly.
    selected: ['monday-14', 'monday-15'],
    
    // When true clicking on the day name it will select the entire row
    disableRowSelection: true, // default false
    
    // When true clicking on the hour it will select the entire columns
    disableColumnSelection: true, // default false

    // When true week starts on Monday and ends on Sunday.  When false week starts on Sunday and ends Saturday
    slavicWeek: false //defaults false
};

Call the directive from your page

<angular-dayparts options="options"></angular-dayparts>

License

Released under the terms of MIT License.

About

Angular directive for select hours in a week


Languages

Language:JavaScript 39.5%Language:HTML 32.8%Language:CSS 27.7%