Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.3.1] - 2026-02-04

### Updated

- Updated functions of the `DateFormatter` to a newer version

## [2.3.0] - 2026-02-04

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"publishConfig": {
"access": "public"
},
"version": "2.3.0",
"version": "2.3.1",
"license": "MIT",
"private": false,
"engines": {
Expand Down
21 changes: 12 additions & 9 deletions src/util/PatternCompiler/Plugin/DateFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ export class DateFormatter {
static getZoneAdjustedWeekday = (
dateString: string,
options: {
timezone: string;
timezone: string | undefined;
locale: string | undefined;
}
},
defaultTimeZone: string = 'Europe/Berlin'
) => {
const timezone = options.timezone;
const timezone = options.timezone ?? defaultTimeZone;

return new Date(dateString).toLocaleDateString(options.locale, {
weekday: 'long',
Expand All @@ -96,11 +97,12 @@ export class DateFormatter {
static getZoneAdjustedDate = (
dateString: string,
options: {
timezone: string;
timezone: string | undefined;
locale: string | undefined;
}
},
defaultTimeZone: string = 'Europe/Berlin'
) => {
const timezone = options.timezone;
const timezone = options.timezone ?? defaultTimeZone;

return new Date(dateString).toLocaleDateString(options.locale, {
month: 'long',
Expand All @@ -112,11 +114,12 @@ export class DateFormatter {
static getZoneAdjustedTime = (
dateString: string,
options: {
timezone: string;
timezone: string | undefined;
locale: string | undefined;
}
},
defaultTimeZone: string = 'Europe/Berlin'
) => {
const timezone = options.timezone;
const timezone = options.timezone ?? defaultTimeZone;

return new Date(dateString)
.toLocaleTimeString(options.locale, {
Expand Down
Loading