Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jdewit committed Oct 6, 2013
2 parents ff2160c + 8869cf8 commit 263fdfd
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 29 deletions.
33 changes: 14 additions & 19 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,20 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-bump');

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
project: 'bootstrap-timepicker',
version: '0.2.3'
'pkg': grunt.file.readJSON('package.json'),
'meta': {
project: '<%= pkg.name %>',
version: '<%= pkg.version %>'
},
'gh-pages': {
'bump': {
options: {
add: true,
push: false
},
src: [
'css/bootstrap-timepicker.min.css',
'js/bootstrap-timepicker.min.js'
]
files: ['package.json', 'component.json', 'composer.json']
}
},
jasmine: {
'jasmine': {
build: {
src : ['spec/js/libs/jquery/jquery.min.js', 'spec/js/libs/bootstrap/js/bootstrap.min.js', 'spec/js/libs/autotype/index.js', 'js/bootstrap-timepicker.js'],
options: {
Expand All @@ -34,7 +29,7 @@ module.exports = function(grunt) {
}
}
},
jshint: {
'jshint': {
options: {
browser: true,
camelcase: true,
Expand Down Expand Up @@ -68,7 +63,7 @@ module.exports = function(grunt) {
},
files: ['js/bootstrap-timepicker.js', 'Gruntfile.js', 'package.json', 'spec/js/*Spec.js']
},
less: {
'less': {
dev: {
options: {
paths: ['css']
Expand All @@ -87,9 +82,9 @@ module.exports = function(grunt) {
}
}
},
uglify: {
'uglify': {
options: {
banner: '/*! <%= meta.project %> v<%= meta.version %> \n' +
banner: '/*! <%= pkg.name %> v<%= pkg.version %> \n' +
'* http://jdewit.github.com/bootstrap-timepicker \n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> Joris de Wit \n' +
'* MIT License \n' +
Expand All @@ -100,7 +95,7 @@ module.exports = function(grunt) {
dest: 'js/<%= pkg.name %>.min.js'
}
},
watch: {
'watch': {
js: {
files: ['js/bootstrap-timepicker.js', 'spec/js/*Spec.js'],
tasks: ['jshint', 'jasmine'],
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ $ bower install
$ grunt test // run jshint and jasmine tests
$ grunt watch // run jsHint and Jasmine tests whenever a file is changed
$ grunt compile // minify the js and css files
$ grunt gh-pages // push updates to gh-pages
$ grunt bump:[patch/minor/major] // bump the version
```

- Please make it easy on me by covering any new features or issues
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.2.2/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/prettify/prettify.js"></script>
<script type="text/javascript" src="js/bootstrap-timepicker.min.js?v0.2.4"></script>
<script type="text/javascript" src="js/bootstrap-timepicker.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#timepicker1').timepicker();
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-timepicker",
"version": "0.2.3",
"version": "0.2.4",
"description": "A timepicker component for Twitter Bootstrap 2.x",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "jdewit/bootstrap-timepicker",
"description" : "A simple timepicker component for Twitter Bootstrap.",
"version" : "0.2.3",
"version" : "0.2.4",
"license" : "MIT",
"authors": [
{
Expand Down
1 change: 1 addition & 0 deletions css/bootstrap-timepicker.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
}
.bootstrap-timepicker-widget table td a i {
margin-top: 2px;
font-size: 18px;
}
.bootstrap-timepicker-widget table td input {
width: 25px;
Expand Down
4 changes: 2 additions & 2 deletions js/bootstrap-timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@
if (defaultTime === 'current') {
var dTime = new Date(),
hours = dTime.getHours(),
minutes = Math.floor(dTime.getMinutes() / this.minuteStep) * this.minuteStep,
seconds = Math.floor(dTime.getSeconds() / this.secondStep) * this.secondStep,
minutes = Math.ceil(dTime.getMinutes() / this.minuteStep) * this.minuteStep,
seconds = Math.ceil(dTime.getSeconds() / this.secondStep) * this.secondStep,
meridian = 'AM';

if (this.showMeridian) {
Expand Down
4 changes: 2 additions & 2 deletions js/bootstrap-timepicker.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bootstrap-timepicker",
"description": "Timepicker widget for Twitter Bootstrap 2.*",
"version": "0.2.3",
"version": "0.2.4",
"homepage": "http://jdewit.github.com/bootstrap-timepicker",
"author": {
"name": "Joris de Wit",
Expand All @@ -27,6 +27,7 @@
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jasmine": "~0.4.2",
"grunt-contrib-watch": "~0.4.3",
"grunt-gh-pages": "~0.7.6"
"grunt-shell": "~0.2.2",
"grunt-bump": "0.0.11"
}
}
5 changes: 4 additions & 1 deletion spec/js/TimepickerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,14 @@ describe('Timepicker feature', function() {
it('should have current time by default', function() {
var dTime = new Date(),
hour = dTime.getHours(),
minute = Math.floor(dTime.getMinutes() / tp1.minuteStep) * tp1.minuteStep;
minute = Math.ceil(dTime.getMinutes() / tp1.minuteStep) * tp1.minuteStep;

if (hour > 12) {
hour = hour - 12;
}
if (hour === 0) {
hour = 12;
}

expect(tp1.hour).toBe(hour);
expect(tp1.minute).toBe(minute);
Expand Down

0 comments on commit 263fdfd

Please sign in to comment.