Skip to content

Add faker.currency and faker.date modules - #11

Open
imitelis wants to merge 1 commit into
paraseba:masterfrom
imitelis:add-currency-date
Open

Add faker.currency and faker.date modules#11
imitelis wants to merge 1 commit into
paraseba:masterfrom
imitelis:add-currency-date

Conversation

@imitelis

@imitelis imitelis commented Jul 26, 2026

Copy link
Copy Markdown

Summary

Adds 2 new faker modules, modeled after the Ruby Faker gem's Currency and Date modules. Follows the existing data/API separation pattern (.cljc, cross-platform).

faker.currency

ISO 4217 data (160+ currencies): code, currency-name, currency-symbol, currency (map), amount

faker.date

  • month/month-abbr/day-of-week/day-of-week-abbr — calendar names
  • past/future-date — with unit selection (:days, :hours, etc.) and optional anchor Instant
  • between/between-except — Instant range, with optional exclusion date
  • birthday — age-range constrained LocalDate
  • in-date-period — random date within a specific month/year
  • on-day-of-week-between — constrain to specific weekdays (single day or vector)
  • date-string — formatted output with pattern strings
  • timestamp — Unix epoch seconds
  • date-of — relative dates (:today, :yesterday, :tomorrow)

Tests

All tests pass: 8 tests, 67 assertions, 0 failures.

Files

  • src/faker/currency.cljc, src/faker/currency_data.cljc
  • src/faker/date.cljc, src/faker/date_data.cljc
  • Updated: test/faker/core_test.clj

@imitelis

Copy link
Copy Markdown
Author

@paraseba Hi! Added two new faker modules (currency and date) following the existing patterns in the repo. Would appreciate a review when you get a chance. Thanks!

Modeled after the Ruby Faker gem's Currency and Date modules.

New modules following the existing data/API separation pattern:

- faker.currency: ISO 4217 data (160+ currencies), code/currency-name/currency-symbol/currency/amount
- faker.date: month/day names, past/future-date/between with unit selection and
  optional anchor Instant, between-except, birthday with age range,
  in-date-period, on-day-of-week-between, date-string formatting,
  timestamp, date-of relative dates

All .cljc for cross-platform compatibility. Includes tests (67 assertions, 0 failures).
@imitelis
imitelis force-pushed the add-currency-date branch from c05bdcf to ff610b4 Compare July 26, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant