# Get Thing whose date field is less than end of current month

Is there an easy way to retrieve a Thing whose Date field is ‘less than end of the current month?’

I haven’t actually tested this, but it should be straightforward to get the first day of the next month; so anything less than that - i.e. less than 12:00am on the 1st - would include everything through the end of the current month.

I wasn’t sure how to get the first day of the next month so I’ve ended up doing this:

At time of storing Thing’s date, extract month number into a separate number field.
Then when this month number is equal to the current date/time month number, display Thing.

Probably the long way of doing this but maths is not my strong point.

This should work even in December, because the year will automatically “roll over”.

That’s your “reference date”. Anything less than that will include the current month. Of course, you can add a lower bound if need be.

EDIT: And if by this…

…you actually mean only dates within (not just “less than the end of”) the current month, then you’ll need to add a lower bound - i.e. create a date range. Thus, you’d search for dates greater than or equal to the 1st of the current month and less than the 1st of next month.

Hi Shot, so I tried this today and it’s a bit weird because text will print out accurately. Eg: This will correctly print out ‘Nov 30, 2019’

but if I use the same logic in a search for, it will only find events that have a date up to Nov 29 but will not find any events on Nov 30. Any idea why?

I wonder if it would help to change the upper date bound (later date) as I suggested…

It makes more intuitive sense, since there is no such thing as a date of “0”. Let me know if it helps.

1 Like

Hi Shot,

Yes that works thanks and I understand it now. I had misread the Bubble reference guide for ‘change date to’ and thought it was still adding a number instead of changing to a date.

Makes perfect sense now! Thank you so much for taking the time to respond and so clearly outline the solution. I’ll pay it forward to another Bubbler.

Jess

1 Like

Get the Timex plug-in and get dates of the current month then use the < smaller sign of the item in the list

Hmmm. I feel I need to cut down on the number of plugins I use. This works as is for now.

This topic was automatically closed after 70 days. New replies are no longer allowed.