Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

withISO8601Dates #2767

Open
tzhao opened this issue Sep 15, 2022 · 3 comments
Open

withISO8601Dates #2767

tzhao opened this issue Sep 15, 2022 · 3 comments

Comments

@tzhao
Copy link

tzhao commented Sep 15, 2022

Expected Behavior

ElideSettingsBuilder builder = (new ElideSettingsBuilder(dataStore))
.withEntityDictionary(dictionary)
.withISO8601Dates("MM/dd/yyyy", TimeZone.getTimeZone("UTC"))

Output date format like: 09/15/2022

Current Behavior

.withISO8601Dates("MM/dd/yyy", TimeZone.getTimeZone("UTC")) doesn't work, always output yyyy-MM-dd'T'HH:mm'Z'
Output example: 2022-05-23T21:03Z

Possible Solution

Elide V4 works as expected

Steps to Reproduce (for bugs)

Context

Your Environment

  • Elide version used: 6.1.7
  • Environment name and version (Java 1.8.0_152): Java 17
  • Operating System and version: Linux
  • Link to your project:
@aklish
Copy link
Member

aklish commented Sep 16, 2022

I can't reproduce this.

I get:

{"data":[{"type":"group","id":"com.example.repository","attributes":{"commonName":"Example Repository","createdAt":"09/16/2022","description":"The code for this project"},"relationships":{"products":{"data":[]}}}]}

If I configure:

.withISO8601Dates("MM/dd/yyyy", TimeZone.getTimeZone("UTC"))

Can you produce a working example with the issue?

@tzhao
Copy link
Author

tzhao commented Sep 16, 2022

@configuration
public class ElideConfig {

	@Bean
public Elide initializeElide(EntityDictionary dictionary, DataStore dataStore, ElideConfigProperties settings) {
	
	ElideSettingsBuilder builder = (new ElideSettingsBuilder(dataStore))
    		.withDefaultMaxPageSize(100)
    		.withDefaultPageSize(100)
    		.withEntityDictionary(dictionary)
    		//.withEpochDates()
    		//.withDefaultSerdes()
    		.withISO8601Dates("MM/dd/yyyy", TimeZone.getTimeZone("UTC"))
            .withJSONApiLinks(new DefaultJSONApiLinks());
	
    return new Elide(builder.build());
}

}

Here is my config file Elide v6.1.7, Spring Boot 2.7.3

@aklish
Copy link
Member

aklish commented Feb 11, 2023

Can you reproduce this with elide-spring-boot-example and publish a branch? Then I can debug it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants