Calendar getActualMinimum - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Calendar getActualMinimum method.

This code example shows how to use the following methods:equals, get, getActualMaximum, getActualMinimum
7
CodeRank
This code example shows how to use the following methods:get, getActualMinimum, roll, set
        cal1.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), 0, 0, 0);
        return new Date(cal1.getTimeInMillis());
    } 
 
    public static Calendar getFistDayOfNextYear(Calendar cal) {
        cal.roll(Calendar.YEAR, 1);
        cal.set(Calendar.MONTH, Calendar.JANUARY);
        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DATE));
        Calendar cal1 = new DateTimeService().getCurrentDateTime().toGregorianCalendar();
        cal1.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), 0, 0, 0);
        return cal1;
    } 
 
    public static Date getLastDayOfNextYear() {
        Calendar cal = getCurrentDateCalendar();
        cal.set(Calendar.MONTH, Calendar.DECEMBER);
        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
        Calendar cal1 = getCurrentDateCalendar();
        cal1.set(cal.get(Calendar.YEAR) + 1, cal.get(Calendar.MONTH), cal.get(Calendar.DATE), 0, 0, 0);
        return cal1.getTime();
7
CodeRank
This code example shows how to use the following methods:add, get, getActualMinimum, getTime
     * @param sdf    A format for the presentation of the date in the <code>datetimestring</code> field. 
     * @return A JDom xml <code>Document</code> with information about the specified date. 
     */ 
    public Document getFormattedDate( int offset, SimpleDateFormat sdf )
    { 
        Calendar today = new GregorianCalendar();
        if ( offset != 0 )
        { 
            today.add( Calendar.DATE, offset );
        } 
 
        org.jdom.Element root = new org.jdom.Element( "formatteddate" );
        org.jdom.Document doc = new org.jdom.Document( root );
        root.addContent( new Element( "datetimestring" ).setText( sdf.format( today.getTime() ) ) );
        root.addContent( new Element( "day" ).setText( Integer.toString( today.get( Calendar.DATE ) ) ) );
        root.addContent( new Element( "month" ).setText( Integer.toString( today.get( Calendar.MONTH ) ) ) );
        root.addContent( new Element( "monthofyear" ).setText(
            Integer.toString( today.get( Calendar.MONTH ) + ( today.getActualMinimum( Calendar.MONTH ) == 0 ? 1 : 0 ) ) ) );
        root.addContent( new Element( "year" ).setText( Integer.toString( today.get( Calendar.YEAR ) ) ) );
        root.addContent( new Element( "hour" ).setText( Integer.toString( today.get( Calendar.HOUR_OF_DAY ) ) ) );

6
CodeRank
This code example shows how to use the following methods:get, getActualMaximum, getActualMinimum
5
CodeRank
This code example shows how to use the following methods:getActualMinimum
	/** 
	 * {@link java.util.Calendar#getActualMinimum(int)} 
	 */ 
	public void test_getActualMinimum_I() { 
		Calendar c = new MockCalendar();
		assertEquals("should be equal to 0", 0, c.getActualMinimum(0));
	} 
 
	protected void setUp() { 
		defaultLocale = Locale.getDefault();
		Locale.setDefault(Locale.US);
	} 
 
	protected void tearDown() { 
		Locale.setDefault(defaultLocale);
	} 
} 
2
CodeRank
This code example shows how to use the following methods:equals, get, getActualMaximum, getActualMinimum
2
CodeRank

Related Calendar getActualMinimum Questions & Answers:

getActualMinimum Method Overview
Returns the minimum value that the specified calendar field could have, given the time value of this Calendar.
See Code Examples for other Java 8 Calendar Methods: