Problem I’ve been struggling to get to grips with Joda-Time, but feel that I’ve finnaly managed to get a grip […]
Tag: jodatime
Check if the user is 18 years old (upto days)
Problem This code is returning ‘true’ for any date which are later than Feb 24, 1998. //minimumAge is number of […]
Generate n appointments in the next m months
Problem I work with an API where I need to write code to generate n appointment dates in the coming […]
Creating custom week start and week number
Problem import org.joda.time.DateTime; import org.joda.time.DateTimeConstants; import org.joda.time.MutableDateTime; import org.joda.time.ReadWritableDateTime; import org.joda.time.Weeks; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class WorkDateUtils […]
Creating students and instructors
Problem It’s simple. Person is a superclass. Student and Instructor are its subclasses. The program suppose to allow user create […]
Creating custom week start and week number
Problem import org.joda.time.DateTime; import org.joda.time.DateTimeConstants; import org.joda.time.MutableDateTime; import org.joda.time.ReadWritableDateTime; import org.joda.time.Weeks; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class WorkDateUtils […]
Check if current time is within the timeframe using Joda-Time
Problem Novice Java developer here. I’ve never really used a time/date library before and I’m curious how an experienced developer […]
JAXB XJC code generation – adding @XmlRootElement and Joda DateTime
Problem Here’s an interesting scenario that I encountered the other day. I did eventually reach a solution on my own. […]