1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.core
21 
22 import java.time.format.{DateTimeFormatter, DateTimeFormatterBuilder}
23 import java.time.temporal.ChronoField._
24 
25 object DateFormatters {
26 
27   val default: DateTimeFormatter =
28     new DateTimeFormatterBuilder()
29       .append(DateTimeFormatter.ISO_LOCAL_DATE)
30       .appendLiteral("T")
31       .appendValue(HOUR_OF_DAY, 2)
32       .appendLiteral(':')
33       .appendValue(MINUTE_OF_HOUR, 2)
34       .optionalStart
35       .appendLiteral(':')
36       .appendValue(SECOND_OF_MINUTE, 2)
37       .optionalStart
38       .appendFraction(NANO_OF_SECOND, 3, 3, true)
39       .appendOffsetId
40       .toFormatter
41 }
Line Stmt Id Pos Tree Symbol Tests Code
40 986 943 - 1345 Apply java.time.format.DateTimeFormatterBuilder.toFormatter org.make.api.proposal.proposalstatetest,org.make.api.sequence.sequenceapitest,org.make.core.proposal.indexed.proposaltest new java.time.format.DateTimeFormatterBuilder().append(java.time.format.DateTimeFormatter.ISO_LOCAL_DATE).appendLiteral("T").appendValue(HOUR_OF_DAY, 2).appendLiteral(':').appendValue(MINUTE_OF_HOUR, 2).optionalStart().appendLiteral(':').appendValue(SECOND_OF_MINUTE, 2).optionalStart().appendFraction(NANO_OF_SECOND, 3, 3, true).appendOffsetId().toFormatter()