Skip to content

Commit

Permalink
fix: the diff UI shows Dates that include millisecond precision
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoramirez committed Nov 9, 2023
1 parent ec5dcb4 commit 296781f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.netflix.hollow.core.schema.HollowObjectSchema;
import com.netflix.hollow.core.schema.HollowObjectSchema.FieldType;
import com.netflix.hollow.diffview.effigy.HollowEffigy.Field;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Date;
Expand All @@ -39,6 +40,8 @@

public class HollowEffigyFactory {

private static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss.SSS z yyyy");

private final Base64.Encoder base64 = Base64.getEncoder();
private final Map<HollowEffigy.Field, HollowEffigy.Field> fieldMemoizer = new HashMap<HollowEffigy.Field, HollowEffigy.Field>();

Expand Down Expand Up @@ -111,7 +114,7 @@ List<Field> createObjectFields(HollowEffigy effigy) {
case LONG:
long longVal = typeDataAccess.readLong(effigy.ordinal, i);
if(longVal != Long.MIN_VALUE && "Date".equals(typeDataAccess.getSchema().getName()))
fieldValue = new Date(longVal).toString();
fieldValue = simpleDateFormat.format(new Date(longVal));
else
fieldValue = Long.valueOf(typeDataAccess.readLong(effigy.ordinal, i));
break;
Expand Down

0 comments on commit 296781f

Please sign in to comment.