Skip to content

Commit

Permalink
fixed issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiran.gyawali committed Nov 16, 2018
1 parent fcaea3f commit 7d0080a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.hornet.nepalidateconverter"
Expand All @@ -27,5 +27,5 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation project(':library')
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0'
}
13 changes: 10 additions & 3 deletions app/src/main/java/com/hornet/nepalidateconverter/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,19 @@ public void onClick(View v) {
Calendar now = Calendar.getInstance();

if (v.getId() == R.id.materialDatePickerButton) {

/*
DatePickerDialog dpd = DatePickerDialog.newInstance(MainActivity.this,
2015,
3,
17);*/
/*
DatePickerDialog dpd = DatePickerDialog.newInstance(MainActivity.this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH));
*/

DatePickerDialog dpd = DatePickerDialog.newInstance(this);

if (tryNewVersion.isChecked()) {
dpd.setVersion(DatePickerDialog.Version.VERSION_2);
Expand Down Expand Up @@ -159,7 +166,7 @@ public void onClick(View v) {
case R.id.adToBsConvertButton:
try {
Model nepDate = dateConverter.getNepaliDate(yy, mm, dd);
String date="" + nepDate.getYear() + " " + getResources().getString(DateConverter.getNepaliMonthString(nepDate.getMonth())) + " " +
String date = "" + nepDate.getYear() + " " + getResources().getString(DateConverter.getNepaliMonthString(nepDate.getMonth())) + " " +
nepDate.getDay() + " " + getDayOfWeek(nepDate.getDayOfWeek());
outputConversion.setText(date);
} catch (IllegalArgumentException e) {
Expand All @@ -169,7 +176,7 @@ public void onClick(View v) {
case R.id.bsToAdConvertButton:
try {
Model engDate = dateConverter.getEnglishDate(yy, mm, dd);
String date="" + engDate.getYear() + " " + getEnglishMonth(engDate.getMonth()) + " " +
String date = "" + engDate.getYear() + " " + getEnglishMonth(engDate.getMonth()) + " " +
engDate.getDay() + " " + getDayOfWeek(engDate.getDayOfWeek());
outputConversion.setText(date);
} catch (IllegalArgumentException e) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
14 changes: 7 additions & 7 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
buildToolsVersion '28.0.3'

defaultConfig {
minSdkVersion 16
Expand All @@ -21,18 +21,18 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'joda-time:joda-time:2.9.2' // for joda
implementation'com.android.support:support-v4:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:support-v13:28.0.0-rc02'
implementation 'com.android.support:design:28.0.0-rc02'
implementation'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v13:28.0.0'
implementation 'com.android.support:design:28.0.0'

testImplementation 'junit:junit:4.12'
testImplementation 'com.pholser:junit-quickcheck-core:0.7'
testImplementation 'com.pholser:junit-quickcheck-generators:0.7'

androidTestImplementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'

implementation 'org.jetbrains:annotations-java5:15.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public static DatePickerDialog newInstance(OnDateSetListener callBack, int year,

@SuppressWarnings("unused")
public static DatePickerDialog newInstance(OnDateSetListener callback) {
DateConverter dc=new DateConverter();
DateConverter dc = new DateConverter();
return DatePickerDialog.newInstance(callback, dc.getTodayNepaliDate());
}

Expand Down Expand Up @@ -289,8 +289,9 @@ public void onCreate(Bundle savedInstanceState) {


dc = new DateConverter();
mCalendar = dc.getTodayNepaliDate();

if (mCalendar == null) {
mCalendar = dc.getTodayNepaliDate();
}
Log.d("KG: mCalander", ""
+ mCalendar.getYear() + "YEAR: MONTH: "
+ mCalendar.getMonth() + " DAY: "
Expand Down

0 comments on commit 7d0080a

Please sign in to comment.