MonthYear

base: StringFIX 4.4FIX 4.2FIX 5.0 SP2

MonthYear is a FIX datatype defined in FIX 4.4, FIX 4.2 and FIX 5.0 SP2, carried on the wire as String. 5 fields use it.

Wire format

Base type
String
Format
YYYYMM[DD|WW]
Fields
5

A month, optionally with a day or week — the format pattern shows which forms are legal.

What the specification says

FIX 4.4

string field representing month of a year. An optional day of the month can be appended or an optional week code. Valid formats: YYYYMM YYYYMMDD YYYYMMWW Valid values: YYYY = 0000-9999; MM = 01-12; DD = 01-31; WW = w1, w2, w3, w4, w5.

FIX 4.2

char field representing month of a year in YYYYMM format. Valid values: YYYY = 0000-9999, MM = 01-12.

FIX 5.0 SP2

String representing month of a year. An optional day of the month can be appended or an optional week code. Valid formats: YYYYMM YYYYMMDD YYYYMMWW Valid values: YYYY = 0000-9999; MM = 01-12; DD = 01-31; WW = w1, w2, w3, w4, w5.

Descriptions are quoted from the FIX Orchestra sources under the Apache 2.0 licence.

How @boarteam/fix handles it

@boarteam/fix keeps the value as a string; format rules are checked by validate(), which reports validate/invalid-value rather than throwing.

Fields with this datatype

Decode this in your own code

The same engine that produced the decoded example above is an Apache-2.0 npm package with zero runtime dependencies. It runs in Node and in the browser, and parse() returns problems as data instead of throwing.

npm i @boarteam/fix @boarteam/fix-dict-fix44