Skip to content

Cannot format date #225

@bsinou

Description

@bsinou

Hi,

First, thanks for the great job, it helps a lot! I yet have an issue while handling dates.

Expected Behavior

Start and End (retrieved with currentDate) timestamps should be displayed using iso format.

Current Behavior

Date are generated in the form of 8/31/23, 9:00 AM, both in previews and in the payload that is sent to the webhook.

Steps to Reproduce (for bugs)

  1. Define a new template with
    • Date Format: yyyy-MM-ddTHH:mm:ssZ
    • Payload Format: jsonVelocityTemplate
  2. Get the date in the json with eg:
{
        "TimeStarted": "${buildStartTime}", 
        "TimeEnd": "${currentTime}"
}
  1. Try both preview and webhook => dates are still wrongly formatted.

I have also tried to get access to the dateTool object [1] without success.

Your Environment

  • tcWebHooks Version: Initially tried with 1.2.2 (from the market place) and then also with 1.2.4 and 2.0.0-rc2 (directly from github)
  • TeamCity Version: 2023.05.3

Any hint would be greatly appreciated.

[1]: Seems like it has been added for 1.2.4 at least

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions