Formats date into dst using the default format Format: yyyy-MM-dd Offsets: 0123456789
| 132 | // Format: yyyy-MM-dd |
| 133 | // Offsets: 0123456789 |
| 134 | int DateParser::FormatDefault(const DateValue& date, char* dst) { |
| 135 | int year, month, day; |
| 136 | if (!date.ToYearMonthDay(&year, &month, &day)) { |
| 137 | *dst = '\0'; |
| 138 | return -1; |
| 139 | } |
| 140 | else { |
| 141 | ZeroPad(dst, year, 4); |
| 142 | ZeroPad(dst + 5, month, 2); |
| 143 | ZeroPad(dst + 8, day, 2); |
| 144 | dst[7] = dst[4] = '-'; |
| 145 | return SimpleDateFormatTokenizer::DEFAULT_DATE_FMT_LEN; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | string DateParser::Format(const DateTimeFormatContext& dt_ctx, const DateValue& date) { |
| 150 | DCHECK(dt_ctx.toks.size() > 0); |
nothing calls this directly
no test coverage detected