appbaseio / appbaseio/dejavu

date format error

Open
#397 4 comments 0 reactions 1 assignee Claimed by @lakhansamani View on GitHub
bug
Dominant language
JavaScript
Stars
8.5k
Forks
512
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
my dto object has a field with LocalDateTime type

` @DateTimeFormat(pattern = "yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'")
@JsonFormat(pattern = "yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'")
private LocalDateTime createTime;`

and i use RestHighLevelClient write to elasticsearch
` UpdateRequest request = new UpdateRequest(index, id);
Gson gson = new GsonBuilder().registerTypeAdapter(LocalDateTime.class,new LocalDateTimeAdapter()).create();
request.doc(gson.toJson(t), XContentType.JSON)
.docAsUpsert(true);
request.scriptedUpsert(true);
try {
return client.restHighLevelClient.update(request, RequestOptions.DEFAULT);
} catch (IOException e) {
log.error(e.getMessage());
}
return null;`

now ,this datetime format is corret in kibana, but is incorret in dejavu like 'yyyy-08-Sa 07:54:58.366'
`{
"_index": "test_info",
"_type": "_doc",
"_id": "22321",
"_version": 5,
"_score": 1,
"_source": {
"orderNo": "22321",
"terminalNo": "2323",
"createTime": "2020-08-03 07:54:58.366"
},
"fields": {
"createTime": [
"2020-08-03T07:54:58.366Z"
]
}
}`

**Dejavu Version**
v3.4.5

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
![1596442080(1)](https://user-images.githubusercontent.com/10986761/89160442-a43bf600-d5a3-11ea-8446-e623870f3ab9.jpg)
![1596442165](https://user-images.githubusercontent.com/10986761/89160496-be75d400-d5a3-11ea-932f-2488541e2640.jpg)

**Desktop (please complete the following information):**
- OS: windowns 10
- Browser chrome
- Version 84.0.4147.105

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.