Skip to content

Commit

Permalink
roll back incomplete attribution changes
Browse files Browse the repository at this point in the history
  • Loading branch information
warm-coolguy committed Jan 30, 2024
1 parent 9276631 commit 94942dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/plugins/Attributions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## unpublished

- Fix: There were incomplete changes regarding how to write current year and month references. They have been rolled back to `<YEAR>` and `<MONTH>` in both documentation and code.

## 1.2.0

- Feature: Improved implementation to make plugin SPA-ready.
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/Attributions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ All parameters are optional. However, setting neither `layerAttributions` nor `s
| fieldName | type | description |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| id | string | ID of service the attribution relates to. The text will only be shown when the layer is visible. |
| title | string | Attribution text or localization key. May contain HTML. The tags `{{YEAR}}` and `{{MONTH}}` are translated to the current year or month respectively. |
| title | string | Attribution text or localization key. May contain HTML. The tags `<YEAR>` and `<MONTH>` are translated to the current year or month respectively. |
4 changes: 2 additions & 2 deletions packages/plugins/Attributions/src/utils/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ function getVisibleAttributions(
export function formatAttributionText(text: string): string {
const now = new Date()
return text
.replaceAll('{{YEAR}}', now.getFullYear().toString())
.replaceAll('{{MONTH}}', `${now.getMonth() + 1}`.padStart(2, '0'))
.replaceAll('<YEAR>', now.getFullYear().toString())
.replaceAll('<MONTH>', `${now.getMonth() + 1}`.padStart(2, '0'))
}

0 comments on commit 94942dc

Please sign in to comment.