version: 0
type: culture
id: tar
description: Information for Tarsan, a country in Fedran.
baseline: "1832-01-01 / 2390349.5 => 1.1.1832"

_consts:
  - &colon {constant: "."}
  - &dot {constant: "."}
  - &dotdot {constant: ".."}
  - &space {constant: " "}
  - &tsc {constant: "TSC"}
  - &NNNN {ref: nanca, maxDigits: 4, minDigits: 1}
  - &DDD {ref: nancadei, maxDigits: 3, minDigits: 3}
  - &D {ref: mastidei, maxDigits: 2, minDigits: 1}
  - &M {ref: nancamasti, maxDigits: 1, minDigits: 1}
  - &bidashuPeriod {
    ref: bidashu,
    maxDigits: 2,
    minDigits: 1
  }
  - &mugi {
    ref: mugi,
    maxDigits: 2,
    minDigits: 1,
    offset: 1
  }
  - &mugiPeriod {
    ref: mugi,
    maxDigits: 2,
    minDigits: 1
  }
  - &koga {
    ref: koga,
    maxDigits: 2,
    minDigits: 1,
    offset: 1,
    parseJulianOffset: 0.25
  }
  - &kogaPeriod {
    ref: koga,
    maxDigits: 2,
    minDigits: 1
  }

instants:
  refs:
    - tarsan-standard-calendar
    - mifuno-kopachi
  formats:
    # Date Formats
    NNNN:
      type: date
      elements: [*NNNN]
    NNNN TSC:
      type: date
      elements: [*NNNN, *space, *tsc]
    DDD..NNNN:
      type: date
      elements: [*NNNN, *dotdot, *DDD]
    DDD..NNNN TSC:
      type: date
      elements: [*NNNN, *dotdot, *DDD, *space, *tsc]
    D.M.NNNN: &shortDate
      type: date
      elements: [*D, *dot, *M, *dot, *NNNN]
    D.M.NNNN TSC:
      type: date
      elements: [*D, *dot, *M, *dot, *NNNN, *space, *tsc]

    # Date Time Formats
    NNNN K:M:
      type: dateTime
      elements: [*NNNN, *space, *koga, *colon, *mugi]
    NNNN TSC K:M:
      type: dateTime
      elements: [*NNNN, *space, *tsc, *space, *koga, *colon, *mugi]
    DDD..NNNN K:M:
      type: dateTime
      elements: [*NNNN, *dotdot, *DDD, *space, *koga, *colon, *mugi]
    DDD..NNNN TSC K:M:
      type: dateTime
      elements: [
        *NNNN, *dotdot, *DDD, *space, *tsc,
        *space, *koga, *colon, *mugi
      ]
    D.M.NNNN K:M: &shortDateTime
      type: dateTime
      elements: [
        *D, *dot, *M, *dot, *NNNN,
        *space, *koga, *colon, *mugi
      ]
    D.M.NNNN TSC K:M:
      type: dateTime
      elements: [
        *D, *dot, *M, *dot, *NNNN, *space, *tsc,
        *space, *koga, *colon, *mugi
      ]

    # Time Formats
    K:M: &shortTime
      type: time
      elements: [
        *koga, *colon, *mugi
      ]

    # Aliases
    shortDate: *shortDate
    shortDateTime: *shortDateTime
    shortTime: *shortTime
    default: *shortDateTime

periods:
  refs:
    - mifuno-kopachi-period
  formats:
    K:M:
      elements: [*kogaPeriod, *colon, *mugiPeriod]
    K:M:B:
      elements: [*kogaPeriod, *colon, *mugiPeriod, *colon, *bidashuPeriod]
