Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blackboxvision/datetimepicker-edittext
📅 A set of EditTexts with built-in support for Date and TimePicker's using Fragments
https://github.com/blackboxvision/datetimepicker-edittext
android calendar datetimepicker edittext java library timepicker
Last synced: 2 months ago
JSON representation
📅 A set of EditTexts with built-in support for Date and TimePicker's using Fragments
- Host: GitHub
- URL: https://github.com/blackboxvision/datetimepicker-edittext
- Owner: BlackBoxVision
- License: mit
- Created: 2017-01-03T14:21:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-06T16:25:29.000Z (over 1 year ago)
- Last Synced: 2024-04-14T12:54:38.922Z (10 months ago)
- Topics: android, calendar, datetimepicker, edittext, java, library, timepicker
- Language: Kotlin
- Homepage:
- Size: 153 KB
- Stars: 36
- Watchers: 3
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# DateTimePicker EditText
> :calendar: A set of EditTexts with built-in support for Date and TimePicker's using Fragments[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-DateTimePickerEditText-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5029) [![](https://jitpack.io/v/BlackBoxVision/datetimepicker-edittext.svg)](https://jitpack.io/#BlackBoxVision/datetimepicker-edittext)
## Installation
Actually I don't have this library in **JCenter/Maven Central**, so if you want to use, follow the instructions.
**Gradle**
- Add it in your root build.gradle at the end of repositories:
```gradle
allprojects {
repositories {
...
maven {
url "https://jitpack.io"
}
}
}
```- Add the dependency:
```gradle
dependencies {
implementation 'com.github.BlackBoxVision:datetimepicker-edittext:v0.5.0'
}
```**Maven**
- Add this line to repositories section in pom.xml:
```xml
jitpack.io
https://jitpack.io
```
- Add the dependency:
```xmlcom.github.BlackBoxVision
datetimepicker-edittext
v0.5.0```
**SBT**
- Add it in your build.sbt at the end of resolvers:
```sbt
resolvers += "jitpack" at "https://jitpack.io"
```- Add the dependency:
```sbt
libraryDependencies += "com.github.BlackBoxVision" % "datetimepicker-edittext" % "v0.5.0"
```## Sample Usage
In your activity layout xml:
```xml
```
The available tags are the following ones:
- **dateTimePicker:theme**: Reference to a custom theme related to the DatePicker or TimePicker dialog style
- **dateTimePicker:minDate**: String, it must be a string date in the format 'dd/MM/yyyy' or if you want current date pass 'CR_DATE'
- **dateTimePicker:maxDate**: String, it must be a string date in the format 'dd/MM/yyyy' or if you want current date pass 'CR_DATE'
- **dateTimePicker:dateFormat**: String, it represents the format that the date will be shown in the EditText, the default is 'dd/MM/yyyy'
- **dateTimePicker:timeFormat**: String, it represents the format that the time will be shown in the EditText, the default is 'HH:mm'
- **dateTimePicker:is24HourView**: Boolean, it tells the TimePicker how to show itAnd in your Activity class
```java
public final class MainActivity extends AppCompatActivity {private DatePickerEditText datePickerEditText;
private TimePickerEditText timePickerEditText;private DatePickerInputEditText datePickerInputEditText;
private TimePickerInputEditText timePickerInputEditText;@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);datePickerEditText = (DatePickerEditText) findViewById(R.id.datePickerEditText);
timePickerEditText = (TimePickerEditText) findViewById(R.id.timePickerEditText);datePickerInputEditText = (DatePickerInputEditText) findViewById(R.id.datePickerInputEditText);
timePickerInputEditText = (TimePickerInputEditText) findViewById(R.id.timePickerInputEditText);
}
}
```## License
Distributed under the **MIT license**. See [LICENSE](https://github.com/BlackBoxVision/datetimepicker-edittext/blob/master/LICENSE.txt) for more information.