Comments (4)
Sorry, I've found - JavaDatePrinter.java. Thanks!
from android-floatinglabel-widgets.
If someone is interested in:
startDatePicker.setInstantPrinter(new FormatDatePrinter("E, dd.MM.yyyy"));
And custom formatter class:
import com.marvinlabs.widget.floatinglabel.instantpicker.DateInstant;
import com.marvinlabs.widget.floatinglabel.instantpicker.DatePrinter;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
public class FormatDatePrinter<DateInstantT extends DateInstant> implements DatePrinter<DateInstantT> {
final String dateFormat;
public FormatDatePrinter(String dateFormat) {
this.dateFormat = (dateFormat != null) ? dateFormat : "dd.MM.yyyy";
}
@Override
public String print(DateInstant dateInstant) {
if (dateInstant == null) return "";
Calendar cal = new GregorianCalendar(dateInstant.getYear(), dateInstant.getMonthOfYear() + 1, dateInstant.getDayOfMonth());
SimpleDateFormat sdf = new SimpleDateFormat(this.dateFormat);
return sdf.format(cal.getTime());
}
}
from android-floatinglabel-widgets.
Your class could be a useful addition to the library. Thanks.
from android-floatinglabel-widgets.
Re-opening to remember to include that class
from android-floatinglabel-widgets.
Related Issues (20)
- Text misaligned with text cursor HOT 2
- Vertical alignment of text not consistent HOT 11
- Gradle support HOT 1
- Style contains key with bad entry HOT 2
- Gradle error: Library is not a library itself HOT 2
- Limited to minSdkVersion 15 HOT 2
- Disable/Enable widgets programmatically HOT 3
- Specify hint size when textview not empty HOT 1
- Date picker month is -1 HOT 1
- Implement setOnFocusChangeListener() for text fields HOT 1
- Use the new AppCompat widgets
- Labels not animated properly after #29
- NPE with FloatingLabelAutoCompleteTextView and AppCompat 22.1.1 on API 21+ HOT 2
- support for RTL Language HOT 4
- Is it possible to disable drawableRight for pickers? HOT 2
- Label is not floating away when setInputWidgetText() is used HOT 5
- Error in license
- Compatibility with Saaripaar Validation Library
- import to android studio
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-floatinglabel-widgets.