Skip to content

Commit

Permalink
Dates saved in UTC, updated readme, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
valasek committed Jun 24, 2019
1 parent 5c6ea7e commit 521278f
Show file tree
Hide file tree
Showing 20 changed files with 425 additions and 421 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ Here's a couple of areas that could use some love:
## JS Frontend

- [Vue.js](https://vuejs.org/) spa client with webpack
- [Vuetify](https://vuetifyjs.com/en/) - light theme
- [Quasar](https://quasar.dev/)
- [Axios](https://github.com/axios/axios), [date-fns](https://date-fns.org/)
784 changes: 390 additions & 394 deletions client/package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@quasar/extras": "^1.1.3",
"axios": "^0.19.0",
"date-fns": "^2.0.0-alpha.36",
"date-fns-tz": "^1.0.7",
"quasar": "^1.0.0-rc.5"
},
"devDependencies": {
Expand All @@ -36,7 +37,7 @@
"cross-env": "^5.2.0",
"eslint": "^5.10.0",
"eslint-loader": "^2.1.1",
"eslint-plugin-vue": "^5.0.0",
"eslint-plugin-vue": "^5.2.3",
"strip-ansi": "=3.0.1",
"webpack-bundle-analyzer": "^3.3.2"
},
Expand Down
3 changes: 2 additions & 1 deletion client/src/pages/Administration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,11 @@
</q-btn>
</div>
<div class="column">
<!-- url="http://localhost:3000/api/upload/data" -->
<q-uploader
label="Upload"
accept=".zip"
url="http://localhost:3000/api/upload/data"
url="http://192.168.1.102:8080/api/upload/data"
auto-upload
style="max-width: 250px"
/>
Expand Down
38 changes: 19 additions & 19 deletions client/src/pages/Report.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@
{{ props.row.date | formatDate }}
</span>
<span v-else>
<q-input :value="props.row.date | formatDate" dense
@input="val => onUpdateDate({id: props.row.id, date: val.name})"
>
<q-input :value="props.row.date | formatDate" dense >
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy" transition-show="scale" transition-hide="scale"
fit anchor="bottom left" self="top left"
>
<q-date :value="props.row.date" @input="(val) => onDate(props.row.id, val)"
<q-date :value="props.row.date" @input="(val) => onUpdateDate({id: props.row.id, date: val})"
mask="YYYY-MM-DD" :rules="['date']" first-day-of-week="1"
/>
</q-popup-proxy>
Expand Down Expand Up @@ -159,7 +157,8 @@

<script>
import { mapState } from 'vuex'
import { format, isWithinInterval, getISODay, parseISO, addDays } from 'date-fns'
import { isWithinInterval, getISODay, parseISO, addDays } from 'date-fns'
import { format } from 'date-fns-tz'
import { workHoursMixin } from '../mixins/workHoursMixin'
export default {
Expand All @@ -176,14 +175,15 @@ export default {
filters: {
formatDate: function (date) {
if (!date) return ''
return format(parseISO(date), 'iii, M/d')
return format(parseISO(date), 'iii, M/d', Intl.DateTimeFormat().resolvedOptions().timeZone)
}
},
mixins: [ workHoursMixin ],
data () {
return {
utcTimeZone: 'UTC',
lastMaxID: 0,
filter: '',
myPagination: { 'rowsPerPage': 30, 'sortBy': 'date', 'descending': false },
Expand Down Expand Up @@ -361,19 +361,19 @@ export default {
}
this.$store.dispatch('reportedHours/updateAttributeValue', payloadRate)
},
async onUpdateDate (id, date) {
async onUpdateDate (newValue) {
this.$refs.qDateProxy.hide()
let payload = {
id: id,
id: newValue.id,
type: 'date',
value: date
value: newValue.date
}
if (isWithinInterval(parseISO(date), { start: this.dateFrom, end: this.dateTo })) {
if (isWithinInterval(parseISO(newValue.date), { start: this.dateFrom, end: this.dateTo })) {
this.$store.dispatch('reportedHours/updateAttributeValue', payload)
} else {
if (await this.$refs.confirm.open('Please confirm', 'You selected ' + format(parseISO(date), 'iiii, MMM do') + '. The record will be moved to another week. Continue?', { color: 'bg-warning' })) {
if (await this.$refs.confirm.open('Please confirm', 'You selected ' + format(parseISO(newValue.date), 'iiii, MMM do', Intl.DateTimeFormat().resolvedOptions().timeZone) + '. The record will be moved to another week. Continue?', { color: 'bg-warning' })) {
this.$store.dispatch('reportedHours/updateAttributeValue', payload)
this.$store.dispatch('settings/jumpToWeek', parseISO(date))
this.$store.dispatch('settings/jumpToWeek', parseISO(newValue.date))
}
}
},
Expand Down Expand Up @@ -419,21 +419,21 @@ export default {
}
if (totalDailyHoursNew < 48) {
this.$q.notify({
message: 'Over 24 hours reported on ' + format(parseISO(date), 'EEEE'),
message: 'Over 24 hours reported on ' + format(parseISO(date), 'EEEE', Intl.DateTimeFormat().resolvedOptions().timeZone),
icon: 'warning'
})
return hours
}
if (totalDailyHours >= 48) {
this.$q.notify({
message: totalDailyHours + ' hours reported on ' + format(parseISO(date), 'EEEE') + ' and you want to add additional ' + hours + ' hours. Record was not created.',
message: totalDailyHours + ' hours reported on ' + format(parseISO(date), 'EEEE', Intl.DateTimeFormat().resolvedOptions().timeZone) + ' and you want to add additional ' + hours + ' hours. Record was not created.',
icon: 'report_problem'
})
return -1
}
if (totalDailyHoursNew > 48) {
this.$q.notify({
message: 'Only ' + (48 - totalDailyHours).toString() + ' hours added on ' + format(parseISO(date), 'EEEE') + '. You wanted to add ' + hours + ' to already reported ' + totalDailyHours + ' hours.',
message: 'Only ' + (48 - totalDailyHours).toString() + ' hours added on ' + format(parseISO(date), 'EEEE', Intl.DateTimeFormat().resolvedOptions().timeZone) + '. You wanted to add ' + hours + ' to already reported ' + totalDailyHours + ' hours.',
icon: 'warning'
})
return 48 - totalDailyHours
Expand All @@ -448,7 +448,7 @@ export default {
const newRecord = {
id: null,
consultant: this.selectedConsultant,
date: format(d, 'yyyy-MM-dd'),
date: format(d, 'yyyy-MM-dd', { timeZone: this.utcTimeZone }),
hours: 8,
rate: '',
description: '',
Expand All @@ -457,7 +457,7 @@ export default {
const newHrs = this.remainingHoursDaily(newRecord.date, newRecord.hours)
if (newHrs > 0 && newHrs <= newRecord.hours) {
// newRecord.date = format(d, "yyyy-MM-dd'T'HH:mm:ssXXX")
newRecord.date = format(d, "yyyy-MM-dd'T'00:00:00XXX")
newRecord.date = format(d, "yyyy-MM-dd'T'00:00:00XXX", { timeZone: this.utcTimeZone })
newRecord.hours = newHrs
this.$store.dispatch('reportedHours/addRecord', newRecord)
this.lastMaxID = this.maxID
Expand All @@ -466,9 +466,9 @@ export default {
duplicateItem (item, day) {
let nextDay = ''
if (day === 'same') {
nextDay = format(parseISO(item.date), 'yyyy-MM-dd')
nextDay = format(parseISO(item.date), 'yyyy-MM-dd', { timeZone: this.utcTimeZone })
} else {
nextDay = format(addDays(parseISO(item.date), 1), 'yyyy-MM-dd')
nextDay = format(addDays(parseISO(item.date), 1), 'yyyy-MM-dd', { timeZone: this.utcTimeZone })
}
const newHrs = this.remainingHoursDaily(nextDay, item.hours)
if (newHrs > 0 && newHrs <= item.hours) {
Expand Down
Binary file modified client/src/statics/app-logo-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/apple-icon-167x167.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/icon-384x384.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/statics/icons/ms-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions server/documentation/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,22 +247,28 @@ If you or your organization would like to help beta test a Pro version of Timesh

# Release Notes

## Version 1.3.0
Released on June 14, 2019
## Version 1.4.0
Released on June 24, 2019

### Features
* API to retrieve reported records in selected period
* Home page listing top 10 projects
* Footer showing app version and server name

### Usability
* Update to Material Design 2.0. Technical: UI migrated to Quasar
* Material Design 2.0
* Documentation contains API description, mentions UTF-8 for exported files
* Week unlock button moved on Reporting page
* Breadcrumbs added

### Fixes
* Axios security bug
* Overview - table pagination added, shows all records
* Record dates saved in UTC

### Technical
* UI migrated to Quasar
* Refactor component names
* UI migrated from Vuetify to Quasar framework
* Refactor component names

## Version 1.2.3
Released on April 24, 2019
Expand Down

0 comments on commit 521278f

Please sign in to comment.