Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You cannot print semester information using the built-in pattern symbols (see this <a href="http://sourceforge.net/p/joda-time/discussion/337835/thread/79259c3c/" rel="nofollow">similar issue in a bug report</a>). You have two options:</p> <ol> <li><p><strong>Build the logic from scratch</strong></p> <p>You can produce <code>DateTimeFormatter</code> instances using static methods from the <code>DateTimeFormat</code> class:</p> <pre><code>DateTimeFormatter format = DateTimeFormat.forPattern("yyyy"); </code></pre> <p>You can also retrieve the month of the year from a Joda <code>DateTime</code> by calling:</p> <pre><code>myDateTime.monthOfYear().get(); </code></pre> <p><br> </p></li> <li><p><strong>Use <code>DateTimeFormatterBuilder</code> to construct a formatter</strong></p> <p>An alternative, might be to use <a href="http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormatterBuilder.html" rel="nofollow"><code>DateTimeFormatterBuilder</code></a> to construct a custom <code>DateTimeFormatter</code> that displays your preferred text. Something like:</p> <pre><code>DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder(); builder.append(DateTimeFormat.forPattern("yyyy")); builder.appendLiteral(' '); builder.append(new SemesterPrinter()); return builder.toFormatter(); </code></pre> <p>where <code>SemesterPrinter</code> would need to implement <a href="http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimePrinter.html" rel="nofollow"><code>DateTimePrinter</code></a> and would be reponsible for producing the text <code>first semester</code> or <code>second semester</code> based on the supplied date information..</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload