Skip to content

Commit 17ccef4

Browse files
fix missing plurals in date
1 parent af264dd commit 17ccef4

1 file changed

Lines changed: 72 additions & 12 deletions

File tree

lib/code/object/date.rb

Lines changed: 72 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,15 @@ def self.call(**args)
222222
sig(args) do
223223
{
224224
year: (String | Integer).maybe,
225+
years: (String | Integer).maybe,
225226
month: (String | Integer).maybe,
227+
months: (String | Integer).maybe,
226228
day: (String | Integer).maybe,
229+
days: (String | Integer).maybe,
227230
week_day: (String | Integer).maybe,
228-
week: (String | Integer).maybe
231+
week_days: (String | Integer).maybe,
232+
week: (String | Integer).maybe,
233+
weeks: (String | Integer).maybe
229234
}
230235
end
231236

@@ -234,20 +239,30 @@ def self.call(**args)
234239
else
235240
code_add(
236241
year: code_value.code_get(:year),
242+
years: code_value.code_get(:years),
237243
month: code_value.code_get(:month),
244+
months: code_value.code_get(:months),
238245
day: code_value.code_get(:day),
246+
days: code_value.code_get(:days),
239247
week_day: code_value.code_get(:week_day),
240-
week: code_value.code_get(:week)
248+
week_days: code_value.code_get(:week_days),
249+
week: code_value.code_get(:week),
250+
weeks: code_value.code_get(:weeks)
241251
)
242252
end
243253
when "substract"
244254
sig(args) do
245255
{
246256
year: (String | Integer).maybe,
257+
years: (String | Integer).maybe,
247258
month: (String | Integer).maybe,
259+
months: (String | Integer).maybe,
248260
day: (String | Integer).maybe,
261+
days: (String | Integer).maybe,
249262
week_day: (String | Integer).maybe,
250-
week: (String | Integer).maybe
263+
week_days: (String | Integer).maybe,
264+
week: (String | Integer).maybe,
265+
weeks: (String | Integer).maybe
251266
}
252267
end
253268

@@ -256,20 +271,30 @@ def self.call(**args)
256271
else
257272
code_substract(
258273
year: code_value.code_get(:year),
274+
years: code_value.code_get(:years),
259275
month: code_value.code_get(:month),
276+
months: code_value.code_get(:months),
260277
day: code_value.code_get(:day),
278+
days: code_value.code_get(:days),
261279
week_day: code_value.code_get(:week_day),
262-
week: code_value.code_get(:week)
280+
week_days: code_value.code_get(:week_days),
281+
week: code_value.code_get(:week),
282+
weeks: code_value.code_get(:weeks)
263283
)
264284
end
265285
when "change"
266286
sig(args) do
267287
{
268288
year: (String | Integer).maybe,
289+
years: (String | Integer).maybe,
269290
month: (String | Integer).maybe,
291+
months: (String | Integer).maybe,
270292
day: (String | Integer).maybe,
293+
days: (String | Integer).maybe,
271294
week_day: (String | Integer).maybe,
272-
week: (String | Integer).maybe
295+
week_days: (String | Integer).maybe,
296+
week: (String | Integer).maybe,
297+
weeks: (String | Integer).maybe
273298
}
274299
end
275300

@@ -278,10 +303,15 @@ def self.call(**args)
278303
else
279304
code_change(
280305
year: code_value.code_get(:year),
306+
years: code_value.code_get(:years),
281307
month: code_value.code_get(:month),
308+
months: code_value.code_get(:months),
282309
day: code_value.code_get(:day),
310+
days: code_value.code_get(:days),
283311
week_day: code_value.code_get(:week_day),
284-
week: code_value.code_get(:week)
312+
week_days: code_value.code_get(:week_days),
313+
week: code_value.code_get(:week),
314+
weeks: code_value.code_get(:weeks)
285315
)
286316
end
287317
else
@@ -419,10 +449,15 @@ def call(**args)
419449
sig(args) do
420450
{
421451
year: (String | Integer).maybe,
452+
years: (String | Integer).maybe,
422453
month: (String | Integer).maybe,
454+
months: (String | Integer).maybe,
423455
day: (String | Integer).maybe,
456+
days: (String | Integer).maybe,
424457
week_day: (String | Integer).maybe,
425-
week: (String | Integer).maybe
458+
week_days: (String | Integer).maybe,
459+
week: (String | Integer).maybe,
460+
weeks: (String | Integer).maybe
426461
}
427462
end
428463

@@ -431,20 +466,30 @@ def call(**args)
431466
else
432467
code_add(
433468
year: code_value.code_get(:year),
469+
years: code_value.code_get(:years),
434470
month: code_value.code_get(:month),
471+
months: code_value.code_get(:months),
435472
day: code_value.code_get(:day),
473+
days: code_value.code_get(:days),
436474
week_day: code_value.code_get(:week_day),
437-
week: code_value.code_get(:week)
475+
week_days: code_value.code_get(:week_days),
476+
week: code_value.code_get(:week),
477+
weeks: code_value.code_get(:weeks)
438478
)
439479
end
440480
when "substract"
441481
sig(args) do
442482
{
443483
year: (String | Integer).maybe,
484+
years: (String | Integer).maybe,
444485
month: (String | Integer).maybe,
486+
months: (String | Integer).maybe,
445487
day: (String | Integer).maybe,
488+
days: (String | Integer).maybe,
446489
week_day: (String | Integer).maybe,
447-
week: (String | Integer).maybe
490+
week_days: (String | Integer).maybe,
491+
week: (String | Integer).maybe,
492+
weeks: (String | Integer).maybe
448493
}
449494
end
450495

@@ -453,20 +498,30 @@ def call(**args)
453498
else
454499
code_substract(
455500
year: code_value.code_get(:year),
501+
years: code_value.code_get(:years),
456502
month: code_value.code_get(:month),
503+
months: code_value.code_get(:months),
457504
day: code_value.code_get(:day),
505+
days: code_value.code_get(:days),
458506
week_day: code_value.code_get(:week_day),
459-
week: code_value.code_get(:week)
507+
week_days: code_value.code_get(:week_days),
508+
week: code_value.code_get(:week),
509+
weeks: code_value.code_get(:weeks)
460510
)
461511
end
462512
when "change"
463513
sig(args) do
464514
{
465515
year: (String | Integer).maybe,
516+
years: (String | Integer).maybe,
466517
month: (String | Integer).maybe,
518+
months: (String | Integer).maybe,
467519
day: (String | Integer).maybe,
520+
days: (String | Integer).maybe,
468521
week_day: (String | Integer).maybe,
469-
week: (String | Integer).maybe
522+
week_days: (String | Integer).maybe,
523+
week: (String | Integer).maybe,
524+
weeks: (String | Integer).maybe
470525
}
471526
end
472527

@@ -475,10 +530,15 @@ def call(**args)
475530
else
476531
code_change(
477532
year: code_value.code_get(:year),
533+
years: code_value.code_get(:years),
478534
month: code_value.code_get(:month),
535+
months: code_value.code_get(:months),
479536
day: code_value.code_get(:day),
537+
days: code_value.code_get(:days),
480538
week_day: code_value.code_get(:week_day),
481-
week: code_value.code_get(:week)
539+
week_days: code_value.code_get(:week_days),
540+
week: code_value.code_get(:week),
541+
weeks: code_value.code_get(:weeks)
482542
)
483543
end
484544
else

0 commit comments

Comments
 (0)