diff --git a/include/faker-cxx/Structure.h b/include/faker-cxx/Structure.h index 738558f7b..ff8a6a651 100644 --- a/include/faker-cxx/Structure.h +++ b/include/faker-cxx/Structure.h @@ -135,13 +135,19 @@ enum class Token // Datatype module DatatypeBoolean, - // Date module - DatePastDate, - DatefutureDate, - DateRecentDate, - DateSoonDate, - DateBirthdateByAge, - DateBirthdateByYear, + // Date module ISO and Timestamp + DatePastDateISO, + DatePastDateTimestamp, + DatefutureDateISO, + DatefutureDateTimestamp, + DateRecentDateISO, + DateRecentDateTimestamp, + DateSoonDateISO, + DateSoonDateTimestamp, + DateBirthdateByAgeISO, + DateBirthdateByAgeTimestamp, + DateBirthdateByYearISO, + DateBirthdateByYearTimestamp, DateWeekdayName, DateWeekdayAbbreviatedName, DateMontName, diff --git a/src/modules/structure/Structure.cpp b/src/modules/structure/Structure.cpp index 5c93c5fb6..aa5234ab8 100644 --- a/src/modules/structure/Structure.cpp +++ b/src/modules/structure/Structure.cpp @@ -120,12 +120,16 @@ const std::map> moduleFunctions = { {faker::Token::DatatypeBoolean, []() { return std::to_string(faker::Datatype::boolean()); }}, - {faker::Token::DatePastDate, []() { return faker::Date::pastDate(); }}, - {faker::Token::DatefutureDate, []() { return faker::Date::futureDate(); }}, - {faker::Token::DateRecentDate, []() { return faker::Date::recentDate(); }}, - {faker::Token::DateSoonDate, []() { return faker::Date::soonDate(); }}, - {faker::Token::DateBirthdateByAge, []() { return faker::Date::birthdateByAge(); }}, - {faker::Token::DateBirthdateByYear, []() { return faker::Date::birthdateByYear(); }}, + {faker::Token::DatePastDateISO, []() { return faker::Date::pastDate(); }}, + {faker::Token::DatePastDateTimestamp, []() { return faker::Date::pastDate(1, faker::Date::DateFormat::Timestamp); }}, + {faker::Token::DatefutureDateISO, []() { return faker::Date::futureDate(); }}, + {faker::Token::DatefutureDateTimestamp, []() { return faker::Date::futureDate(1, faker::Date::DateFormat::Timestamp); }}, + {faker::Token::DateRecentDateISO, []() { return faker::Date::recentDate(); }}, + {faker::Token::DateRecentDateTimestamp, []() { return faker::Date::recentDate(3, faker::Date::DateFormat::Timestamp); }}, + {faker::Token::DateSoonDateISO, []() { return faker::Date::soonDate(); }}, + {faker::Token::DateSoonDateTimestamp, []() { return faker::Date::soonDate(3, faker::Date::DateFormat::Timestamp); }}, + {faker::Token::DateBirthdateByAgeISO, []() { return faker::Date::birthdateByAge(); }}, + {faker::Token::DateBirthdateByYearTimestamp, []() { return faker::Date::birthdateByYear(1920, 2000, faker::Date::DateFormat::Timestamp); }}, {faker::Token::DateWeekdayName, []() { return faker::Date::weekdayName(); }}, {faker::Token::DateWeekdayAbbreviatedName, []() { return faker::Date::weekdayAbbreviatedName(); }}, {faker::Token::DateMontName, []() { return faker::Date::monthName(); }},