I want to judge the range using the monthly degree

problem

I want to get it before September when I have monthly data, Since January, February, and March are the data for the next year, you may not want to include them. At that time, make a note of an example of how to remove it easily.

How to do

Convert each month to be compared as follows, It can be solved by judging using the converted value.


(Monthly+ 8) % 12

For example, when retrieving data before September By setting the monthly conversion value of the acquisition source data <= the reference monthly conversion value, Only April, June, July, August and September will be available. This is because the converted value will be as follows. Since the converted value for September is "5", you can get April to September, which is less than that value.

Monthly Converted value
1 9
2 10
3 11
4 0
5 1
6 2
7 3
8 4
9 5
10 6
11 7
12 8

Recommended Posts

I want to judge the range using the monthly degree
I want to call the main method using reflection
I want to limit the input by narrowing the range of numbers
I want to display the number of orders for today using datetime.
I want to output the day of the week
I want to var_dump the contents of the intent
I want to truncate after the decimal point
I want to get the value in Ruby
I want to create the strongest local development environment using VSCode Remote Containers
[Java] I want to calculate the difference from the date
I want to embed any TraceId in the log
I want to know the answer of the rock-paper-scissors app
I want to display the name of the poster of the comment
I want to dark mode with the SWT app
[Rough commentary] I want to marry the pluck method
I want to be aware of the contents of variables!
I want to return the scroll position of UITableView!
I want to simplify the log output on Android
I want to add a delete function to the comment function
I want to find a relative path in a situation using Path
I want to set the conditions to be displayed in collection_check_boxes
[Rails] [bootstrap] I want to change the font size responsively
I want to use screen sharing on the login screen on Ubuntu 18
I want to build Java Applet without using an IDE
(ยด-`) .. oO (I want to easily find the standard output "Hello".
I want to bring Tomcat to the server and start the application
I want to expand the clickable part of the link_to method
I want to change the log output settings of UtilLoggingJdbcLogger
I want to call a method and count the number
I want to use the Java 8 DateTime API slowly (now)
I want to create a form to select the [Rails] category
I want to use the sanitize method other than View.
[Rails] I want to display "XX minutes ago" using created_at!
I tried to build the environment little by little using docker
I want to put the JDK on my Mac PC
I want to give a class name to the select attribute
I want to recursively search the class list under the package
I want to distinct the duplicated data with has_many through
I want to transition to the same screen in the saved state
I want to narrow down the display of docker ps
I want to return multiple return values for the input argument
[Ruby] I want to reverse the order of the hash table
I want to temporarily disable the swipe gesture of UIPageViewController
I want to pass the startup command to postgres with docker-compose.
I want to simplify the conditional if-else statement in Java
I want to use Java Applet easily on the command line without using an IDE
Swift: I want to chain arrays
I want to judge the necessity of testing by comparing the difference of class files when refactoring Java
[Metal] I tried to figure out the flow until rendering using Metal
I want to create a chat screen for the Swift chat app!
I want to understand the flow of Spring processing request parameters
I just want to write Java using Eclipse on my Mac
I want to use FormObject well
I want to return to the previous screen with kotlin and java!
The story of Collectors.groupingBy that I want to keep for posterity
I want to convert InputStream to String
I tried to explain the method
I want to docker-compose up Next.js!
[Eclipse] I want to open the same file twice [Split editor]
The story I wanted to unzip
I want to add the disabled option to f.radio_button depending on the condition