citrusframework / citrusframework/citrus
Configurable default date format for date functions
- Dominant language
- Java
- Stars
- 485
- Forks
- 155
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 6
Description
**User story**
As a user of the _citrus:currentDate()_ and _citrus:changeDate()_ functions I want to define a default date format via test variables so that the test becomes cleaner without repeated format strings.
**Additional context**
Currently the _getDefaultDateFormat()_ in the AbstractDateFunction always returns a format based on 'dd.MM.yyyy'. We extensively use ISO8601 formatted datetime strings, having to constantly provide this format string makes the test code rather ugly.
It would be much nicer if I could set a variable in my test case:
`citrus.default.datetime.format=yyyy-MM-dd'T'HH:mm:ssZ`
which is used in case the date functions did not get a format parameter.
Contributor guide
Research direction
Start with AbstractDateFunction and its getDefaultDateFormat() implementation, then trace how citrus:currentDate() and citrus:changeDate() obtain format parameters and test variables. Confirm the existing dd.MM.yyyy fallback and identify the relevant date-function tests or entry points. Done means an unset format retains current behavior and citrus.default.datetime.format is used when no format parameter is supplied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100