{"record":{"id":"7aea7548445cc0c1","repo":"faker-ruby/faker","slug":"there-is-no-days-of-week-date-wday-capitalize","errorCode":null,"errorMessage":"There is no #{DAYS_OF_WEEK[date.wday].capitalize} between #{from} and #{to}. Increase the from/to date range or choose a different day of the week.","messagePattern":"There is no #(.+?) between #(.+?) and #(.+?)\\. Increase the from/to date range or choose a different day of the week\\.","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/faker/default/date.rb","lineNumber":179,"sourceCode":"        numeric_weekdays = days.map do |d|\n          DAYS_OF_WEEK.index(d.to_sym.downcase) || raise(ArgumentError, \"#{d} is not a valid day of the week\")\n        end\n\n        from = get_date_object(from)\n        to   = get_date_object(to)\n        date = Faker::Base.rand_in_range(from, to)\n\n        # If the initial date is not on one of the wanted days of the week...\n        unless numeric_weekdays.include? date.wday\n          # ...pick a date nearby that is on one of the wanted days of the week instead\n          date += sample(numeric_weekdays) - date.wday\n\n          # Move date 1 week earlier or later if the adjusted date is now outside the date range\n          date += 7 if date < from\n          date -= 7 if date > to\n\n          if date > to || date < from\n            raise ArgumentError,\n                  \"There is no #{DAYS_OF_WEEK[date.wday].capitalize} between #{from} and #{to}. Increase the from/to date range or choose a different day of the week.\"\n          end\n        end\n\n        date\n      end\n\n      private\n\n      def birthday_date(date, age)\n        year = date.year - age\n\n        day =\n          if date.day == 29 && date.month == 2 && !::Date.leap?(year)\n            28\n          else\n            date.day\n          end","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/faker-ruby/faker/blob/cca4184947e09fdd02afb8b89d25a9c8ebc7274e/lib/faker/default/date.rb#L161-L197","documentation":"Error \"There is no #{DAYS_OF_WEEK[date.wday].capitalize} between #{from} and #{to}. Increase the from/to date range or choose a different day of the week.\" thrown in faker-ruby/faker.","triggerScenarios":"Thrown at lib/faker/default/date.rb:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cca4184947e09fdd02afb8b89d25a9c8ebc7274e","analyzedAt":"2026-08-21T16:25:39.145Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}