File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
main/java/ru/bozaro/gitlfs/common
test/java/ru/bozaro/gitlfs/common/data Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 6
6
import com .fasterxml .jackson .databind .DeserializationFeature ;
7
7
import com .fasterxml .jackson .databind .ObjectMapper ;
8
8
import com .fasterxml .jackson .databind .SerializationFeature ;
9
- import com .fasterxml .jackson .databind .util .ISO8601DateFormat ;
9
+ import com .fasterxml .jackson .databind .util .StdDateFormat ;
10
10
import org .jetbrains .annotations .NotNull ;
11
11
12
12
import java .text .DateFormat ;
17
17
* Json utility class.
18
18
*
19
19
* @author Artem V. Navrotskiy
20
- * @author Marat Radchenko <marat@slonopootamus .org>
20
+ * @author Marat Radchenko <marat@slonopotamus .org>
21
21
*/
22
22
public final class JsonHelper {
23
23
24
24
/**
25
- * git-lfs is broken and doesn't properly parse output of {@link com.fasterxml.jackson.databind.util.StdDateFormat}.
25
+ * git-lfs cannot parse timezone without colon: {@link com.fasterxml.jackson.databind.util.StdDateFormat}.
26
26
* <p/>
27
27
* See https://github.com/git-lfs/git-lfs/issues/3660
28
28
*/
29
29
@ NotNull
30
- public static final DateFormat dateFormat = new ISO8601DateFormat ( );
30
+ public static final DateFormat dateFormat = StdDateFormat . instance . withColonInTimeZone ( true );
31
31
32
32
@ NotNull
33
33
public static final ObjectMapper mapper = new ObjectMapper ();
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ public final class DateTest {
10
10
11
11
@ Test
12
12
public void format () throws ParseException {
13
- final String str = "2006-01-02T15:04:05Z " ;
13
+ final String str = "2006-01-02T15:04:05.123+00:00 " ;
14
14
Assert .assertEquals (JsonHelper .dateFormat .format (JsonHelper .dateFormat .parse (str )), str );
15
15
}
16
16
}
You can’t perform that action at this time.
0 commit comments