title: Momentjs calendar() equivalent for Java
body: <p>Momentjs has the <code>calendar()</code> function to pretty print timespans like below.</p>
  <p>For example:</p>
  <blockquote>
  <p>&quot;Last Monday at 1:14 PM&quot;</p>
  <p>&quot;09/21/2017&quot; (if the date is a while ago)</p>
  </blockquote>
  <p>Is there an equivalent function in Java (Joda-Time if possible)?</p>
  <pre><code>moment().subtract(10, 'days').calendar(); // 09/21/2017
  moment().subtract(6, 'days').calendar();  // Last Monday at 1:14 PM
  moment().subtract(3, 'days').calendar();  // Last Thursday at 1:14 PM
  moment().subtract(1, 'days').calendar();  // Yesterday at 1:14 PM
  moment().calendar();                      // Today at 1:14 PM
  moment().add(1, 'days').calendar();       // Tomorrow at 1:14 PM
  moment().add(3, 'days').calendar();       // Wednesday at 1:14 PM
  moment().add(10, 'days').calendar();      // 10/11/2017
  </code></pre>