Android Date picker dialog setMinDate(long) and setMaxDate(long) issue
My objective was enable date with in certain range & disable the rest for date , so that user can't select those dates. I find these two method for date picker to set the minimum & maximum range. so first I able to disable all future dates with : d.getDatePicker().setMaxDate(System.currentTimeMillis()); this was working fine. Than I disable all dates before two weeks ago with this code : d.getDatePicker().setMaxDate(System.currentTimeMillis() - (2*7*24*60*60*1000)); it was working fine. here 2 for weeks, 7 for days, 24 for hour, 60 for minutes, 60 for seconds & 1000 for millisecond. so from last two weeks to current date my code was like this d.getDatePicker().setMaxDate(System.currentTimeMillis() - (2*7*24*60*60*1000)); d.getDatePicker().setMaxDate(System.currentTimeMillis()); The problem was when i desire to set range earlier this month. this process was not working. As an example i was planning to set date range between 42 weeks to 9 weeks early. t...
Comments
Post a Comment