(ctx *sql.Context, dateOnly bool)
| 192 | ) |
| 193 | |
| 194 | func getLayoutStringFormat(ctx *sql.Context, dateOnly bool) string { |
| 195 | layout := getDateStyleOutputFormat(ctx) |
| 196 | switch layout { |
| 197 | case DateStyleISO: |
| 198 | if dateOnly { |
| 199 | return dateStyleFormatDateOnly_ISO |
| 200 | } |
| 201 | return dateStyleFormat_ISO |
| 202 | case DateStyleSQL: |
| 203 | if dateOnly { |
| 204 | return dateStyleFormatDateOnly_SQL |
| 205 | } |
| 206 | return dateStyleFormat_SQL |
| 207 | case DateStylePostgres: |
| 208 | if dateOnly { |
| 209 | return dateStyleFormatDateOnly_Postgres |
| 210 | } |
| 211 | return dateStyleFormat_Postgres |
| 212 | case DateStyleGerman: |
| 213 | if dateOnly { |
| 214 | return dateStyleFormatDateOnly_German |
| 215 | } |
| 216 | return dateStyleFormat_German |
| 217 | } |
| 218 | // shouldn't happen but return default |
| 219 | if dateOnly { |
| 220 | return dateStyleFormatDateOnly_ISO |
| 221 | } |
| 222 | return dateStyleFormat_ISO |
| 223 | } |
| 224 | |
| 225 | // FormatDateTimeWithBC formats a time.Time that may represent BC dates (negative years) |
| 226 | // PostgreSQL represents BC years as negative years in time.Time, but Go's Format() doesn't handle this correctly |
no test coverage detected