Skip to content

Commit

Permalink
Fixes: Show correct hours in a week between two month, Technical: Upd…
Browse files Browse the repository at this point in the history
…ate to Vue 2.6.8
  • Loading branch information
valasek committed Mar 3, 2019
1 parent e6dd3c8 commit 229925a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 23 deletions.
32 changes: 16 additions & 16 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"babel-polyfill": "^6.26.0",
"date-fns": "^1.30.1",
"moment-timezone": "^0.5.23",
"vue": "^2.6.7",
"vue": "^2.6.8",
"vue-axios": "^2.1.4",
"vue-router": "^3.0.2",
"vuetify": "^1.5.4",
Expand All @@ -25,14 +25,14 @@
"@vue/cli-plugin-eslint": "^3.4.1",
"@vue/cli-service": "^3.4.1",
"babel-eslint": "^10.0.1",
"eslint": "^5.14.1",
"eslint": "^5.15.0",
"eslint-config-vuetify": "^0.2.0",
"eslint-plugin-vue": "^5.2.2",
"npm-check": "^5.9.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"vue-cli-plugin-vuetify": "^0.4.6",
"vue-template-compiler": "^2.6.7",
"vue-template-compiler": "^2.6.8",
"vuetify-loader": "^1.2.1"
},
"eslintConfig": {
Expand Down
4 changes: 2 additions & 2 deletions client/src/views/ReportTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@
computed: {
selectedReportedHours () {
let from = this.dateFrom
let to = this.dateTo
const from = this.dateFrom
const to = this.dateTo
return this.reportedHours.filter(function (report) {
let d = new Date(report.date)
return (d >= from && d <= to)
Expand Down
7 changes: 7 additions & 0 deletions server/data/verification_queries
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
select * from reported_records
select count(distinct id) as active from reported_records
select count(distinct id) as deleted from reported_records where deleted_at is not null

select * from reported_records where extract(MONTH from date) = '02' AND extract(YEAR from date) = '2019' AND consultant = 'Stanislav Valasek'
select count(*) from reported_records where extract(MONTH from date) = '03' AND extract(YEAR from date) = '2019' AND consultant = 'Stanislav Valasek'
select count(*) from reported_records where date(date) in ('2019-02-25', '2019-02-26', '2019-02-27', '2019-02-28')
4 changes: 2 additions & 2 deletions server/models/reportedRecords.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (db *ReportedRecordManager) ReportedRecordsInMonth(year, month, consultant
logger.Log.Error(fmt.Sprintf("failed - get reported records for month %s, year %s and consultant %s, error: %s", month, year, consultant, err))
return nil
}
if err := db.db.Where("date(date) in (?)", days).Find(&borderWeeksReportedRecords); err != nil {
if err := db.db.Where("date(date) in (?) AND consultant = ?", days, consultant).Find(&borderWeeksReportedRecords); err != nil {
reportedRecords = append(reportedRecords, borderWeeksReportedRecords...)
return reportedRecords
}
Expand Down Expand Up @@ -136,7 +136,7 @@ func getborderDays(year, month string) (days []string, err error) {
}

if (sunday.Month() == monthStart.Month()) {
fmt.Println("sunday is also end of the month")
// fmt.Println("sunday is also end of the month")
} else {
for day := 1; day <= sunday.Day(); day++ {
days = append(days, nextYear+"-"+nextMonth+"-"+fmt.Sprintf("%02d", day))
Expand Down

0 comments on commit 229925a

Please sign in to comment.