Skip to content

Commit

Permalink
Merge pull request #4820 from carlobeltrame/shorter-picasso-dates-in-pdf
Browse files Browse the repository at this point in the history
Shorter dates on client print picasso
  • Loading branch information
carlobeltrame committed Mar 31, 2024
2 parents 8141769 + 63ea382 commit 564dd5b
Show file tree
Hide file tree
Showing 12 changed files with 304 additions and 217 deletions.
61 changes: 61 additions & 0 deletions pdf/package-lock.json

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

3 changes: 2 additions & 1 deletion pdf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@
},
"devDependencies": {
"@babel/eslint-parser": "7.24.1",
"@intlify/core": "^9.10.2",
"@rushstack/eslint-patch": "1.10.0",
"@vitejs/plugin-vue": "5.0.4",
"@vitest/coverage-v8": "1.4.0",
"@vue/babel-preset-app": "5.0.8",
"@vue/compiler-dom": "3.4.21",
"@vue/compiler-sfc": "3.4.21",
"@vue/eslint-config-prettier": "9.0.0",
"@vue/test-utils": "2.4.4",
"@vue/runtime-dom": "3.4.21",
"@vue/server-renderer": "3.4.21",
"@vue/shared": "3.4.21",
"@vue/test-utils": "2.4.4",
"css": "3.0.0",
"dayjs": "1.11.10",
"eslint": "8.57.0",
Expand Down
5 changes: 2 additions & 3 deletions pdf/src/campPrint/picasso/DayColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
} from '../../../common/helpers/picasso.js'
import keyBy from 'lodash/keyBy.js'
import dayjs from '../../../common/helpers/dayjs.js'
export default {
name: 'DayColumn',
Expand All @@ -54,15 +53,15 @@ export default {
const radius = '2pt'
return keyBy(
this.relevantScheduleEntries.map((scheduleEntry) => {
const start = dayjs.utc(scheduleEntry.start)
const start = this.$date.utc(scheduleEntry.start)
const startsOnThisDay =
start.isSameOrAfter(dayStart(this.day, this.times)) &&
start.isSameOrBefore(dayEnd(this.day, this.times))
const topStyles = startsOnThisDay
? { borderTopRightRadius: radius, borderTopLeftRadius: radius }
: {}
const end = dayjs.utc(scheduleEntry.end)
const end = this.$date.utc(scheduleEntry.end)
const endsOnThisDay =
end.isSameOrAfter(dayStart(this.day, this.times)) &&
end.isSameOrBefore(dayEnd(this.day, this.times))
Expand Down
7 changes: 6 additions & 1 deletion pdf/src/campPrint/picasso/DayHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ export default {
},
computed: {
date() {
return this.$date.utc(this.day.start).hour(0).minute(0).second(0).format('ddd LL')
return this.$date
.utc(this.day.start)
.hour(0)
.minute(0)
.second(0)
.format(this.$tc('global.datetime.dateLong'))
},
dayResponsibles() {
if (filterDayResponsiblesByDay(this.day).length === 0) return ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
],
"parent": [Circular],
"props": {
"bookmark": "print.cover.title",
"bookmark": "Cover page",
"class": "page",
"id": "entry-0",
"size": "A4",
Expand Down
16 changes: 8 additions & 8 deletions pdf/src/renderer/__tests__/__snapshots__/picasso.spec.json.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "print.picasso.title",
"value": "Program overview Hauptlager",
},
],
"parent": [Circular],
"props": {
"bookmark": {
"fit": true,
"title": "print.picasso.title",
"title": "Program overview Hauptlager",
},
"class": "picasso-title",
"id": "entry-0-16b2fcffdd8e",
Expand Down Expand Up @@ -139,7 +139,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "Fri May 10, 2024",
"value": "Fr 05/10/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -179,7 +179,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "Sat May 11, 2024",
"value": "Sa 05/11/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -218,7 +218,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "Sun May 12, 2024",
"value": "Su 05/12/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -257,7 +257,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "Mon May 13, 2024",
"value": "Mo 05/13/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -8861,7 +8861,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "g5/10/2024obam5/10/2024.5amteti0e.5amte05/10/2024ong - g5/13/2024obam5/13/2024.1amteti0e.1amte05/13/2024ong",
"value": "Fr 05/10/2024 - Mo 05/13/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -8898,7 +8898,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "print.picasso.picassoFooter.leaders",
"value": "Lead: Robert Baden-Powell & Hans Muster",
},
],
"parent": [Circular],
Expand Down
Loading

0 comments on commit 564dd5b

Please sign in to comment.