为“运行年"建议一个好的方法名称. [英] Suggest a good method name for "running year"

查看:69
本文介绍了为“运行年"建议一个好的方法名称.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助提供一个很好的方法名称.实际上,这是一个定义日期限制的范围.这个限制是从今天和过去的365天,基本上到过去的同一天.所以我要说这是滚动的一年.

Please help to come with a nice name for a method. Actually it is a scope that defines limit on date. This limit is from today and 365 days to the past, to the same day in past basically. So this is kind of rolling year I would say.

此方法当前名为#in_last_year.但是我不喜欢.可以理解,就好像它只返回上一年,就像今天是2013年一样,它只返回2012年的日期,但实际上它可以返回昨天或2013年发生的一周前的一天.

This method is currently named #in_last_year. But I don't like it. It can be understand as if it is only returning the previous year, like if today is 2013 it would only return dates in 2012, but actually it can return yesterday or a day a week ago that happens in 2013.

它在伪造(种子)工具中使用.用法如下:

It is used in a faking(seeding) tool. And the usage looks like:

Faker::Date.in_last_year

我以"in_running_year","in_ongoing_year"之类的名字来命名.对于我来说,它们似乎还可以,但是也许在金融界中有这样一个实体的已知术语.

I came with names like "in_running_year", "in_ongoing_year". They seem ok for me, but maybe there are some known term for such entity, probably in finance world.

推荐答案

dates_to.same_day.next_yeardates_from.same_day.last_year

然后您可以使用修饰词,例如星期,月份或十年等.

Then you can have modifier words like week, month, or decade, etc.

这篇关于为“运行年"建议一个好的方法名称.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆