Skip to content

Commit

Permalink
Merge pull request #166 from santiagovazquez/master
Browse files Browse the repository at this point in the history
Using browser TZ instead of UTC and other fixes
  • Loading branch information
eralha committed Oct 6, 2015
2 parents 2f1ff2b + 866ef19 commit f93d448
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 293 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
app/components
.idea
*.iml
.DS_Store
13 changes: 9 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function (grunt) {
watch: {
less: {
files: ['<%= yeoman.app %>/styles/{,*/}*.less'],
tasks: ['recess', 'copy:styles'],
tasks: ['less', 'copy:styles'],
options: {
nospawn: true
}
Expand Down Expand Up @@ -160,15 +160,20 @@ module.exports = function (grunt) {
dist: {
options: {
base: '<%= yeoman.app %>',
module: 'datePicker'
module: 'datePicker',
url: function(templateUrl) {
// on production it should be the same path as the one defined on datePicker.js
return templateUrl.replace('app/', '');
}
},
src: '<%= yeoman.app %>/templates/*.html',
dest: '<%= yeoman.tmp %>/templates.js'

}
},
concurrent: {
server: [
'recess',
'less',
'copy:styles'
],
test: [
Expand Down Expand Up @@ -211,7 +216,7 @@ module.exports = function (grunt) {

grunt.registerTask('server', [
'clean:server',
'recess',
'less',
'concurrent:server',
'connect:livereload',
'open',
Expand Down
2 changes: 0 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ <h5>Date range button</h5>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.6.0/ui-bootstrap-tpls.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-moment/0.10.2/angular-moment.min.js"></script>
<script src="scripts/datePicker.js"></script>
<script src="scripts/datePickerUtils.js"></script>
<script src="scripts/dateRange.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions app/scripts/datePickerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
angular.module('datePicker').factory('datePickerUtils', function(){
var createNewDate = function(year, month, day, hour, minute) {
// without any arguments, the default date will be 1899-12-31T00:00:00.000Z
return new Date(Date.UTC(year | 0, month | 0, day | 0, hour | 0, minute | 0));
return new Date(year | 0, month | 0, day | 0, hour | 0, minute | 0);
};
return {
getVisibleMinutes : function(date, step) {
date = new Date(date || new Date());
var year = date.getFullYear();
var month = date.getMonth();
var day = date.getDate();
var hour = date.getUTCHours();
var hour = date.getHours();
var minutes = [];
var minute, pushedDate;
for (minute = 0 ; minute < 60 ; minute += step) {
Expand Down Expand Up @@ -158,4 +158,4 @@ angular.module('datePicker').factory('datePickerUtils', function(){
}
*/
};
});
});
Loading

0 comments on commit f93d448

Please sign in to comment.