We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! Is it possible to cpecify different date format or should I write new subclass of JavaDateInstant? Thanks!
The text was updated successfully, but these errors were encountered:
Sorry, I've found - JavaDatePrinter.java. Thanks!
Sorry, something went wrong.
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()); } }
Your class could be a useful addition to the library. Thanks.
Re-opening to remember to include that class
vpratfr
No branches or pull requests
Hello! Is it possible to cpecify different date format or should I write new subclass of JavaDateInstant? Thanks!
The text was updated successfully, but these errors were encountered: