Example usage for org.joda.time DurationFieldType millis

List of usage examples for org.joda.time DurationFieldType millis

Introduction

In this page you can find the example usage for org.joda.time DurationFieldType millis.

Prototype

public static DurationFieldType millis() 

Source Link

Document

Get the millis field type.

Usage

From source file:org.chaston.oakfunds.util.DateUtil.java

License:Apache License

public static Instant endOfYear(int year) {
    MutableDateTime mutableDateTime = new MutableDateTime(year, 1, 1, 0, 0, 0, 0);
    mutableDateTime.add(DurationFieldType.years(), 1);
    mutableDateTime.add(DurationFieldType.millis(), -1);
    return mutableDateTime.toInstant();
}

From source file:org.chaston.oakfunds.util.DateUtil.java

License:Apache License

public static Instant endOfMonth(int year, int monthOfYear) {
    MutableDateTime mutableDateTime = new MutableDateTime(year, monthOfYear, 1, 0, 0, 0, 0);
    mutableDateTime.add(DurationFieldType.months(), 1);
    mutableDateTime.add(DurationFieldType.millis(), -1);
    return mutableDateTime.toInstant();
}

From source file:org.chaston.oakfunds.util.DateUtil.java

License:Apache License

public static Instant endOfDay(int year, int monthOfYear, int dayOfMonth) {
    MutableDateTime mutableDateTime = new MutableDateTime(year, monthOfYear, dayOfMonth, 0, 0, 0, 0);
    mutableDateTime.add(DurationFieldType.days(), 1);
    mutableDateTime.add(DurationFieldType.millis(), -1);
    return mutableDateTime.toInstant();
}

From source file:TVShowTimelineMaker.ui.Joda.PeriodEditor.java

/**
 * Creates new form PeriodEditor//from w w w .j av  a 2s.c o m
 */
public PeriodEditor() {
    this.initComponents();
    this.mMutablePeriod = new MutablePeriod();
    CollectionListModel<DurationFieldType> newCollectionListModel = new CollectionListModel<>();
    this.listFields.setModel(newCollectionListModel);
    newCollectionListModel.add(DurationFieldType.days());
    newCollectionListModel.add(DurationFieldType.hours());
    newCollectionListModel.add(DurationFieldType.millis());
    newCollectionListModel.add(DurationFieldType.minutes());
    newCollectionListModel.add(DurationFieldType.months());
    newCollectionListModel.add(DurationFieldType.seconds());
    newCollectionListModel.add(DurationFieldType.weeks());
    newCollectionListModel.add(DurationFieldType.years());
    this.txtOverview.setText(this.mMutablePeriod.toString());
    this.validate();
}