Comments (9)
1.4.2 已修复。
from pgdatepicker.
什么问题,具体描述一下操作步骤以及出现的错误
from pgdatepicker.
麻烦看一下,谢谢
from pgdatepicker.
from pgdatepicker.
按照这个方法设置了,选了开始时间2017-08,再去选结束时间,这是结束时间框的显示,还是不对。
- (void)showDatePicker {
PGDatePicker *datePicker = [[PGDatePicker alloc] init];
datePicker.delegate = self;
datePicker.datePickerMode = PGDatePickerModeYearAndMonth;
NSDateFormatter *dataFormant = [[NSDateFormatter alloc] init];
[dataFormant setDateFormat: @"yyyyMM"];
// 日历
NSCalendar *calendar = [NSCalendar currentCalendar];
NSCalendarUnit unit = NSCalendarUnitYear | NSCalendarUnitMonth;
NSDateComponents *newdateCom = [calendar components:unit fromDate:[NSDate date]];
datePicker.maximumDate = [NSDate setYear:newdateCom.year month:newdateCom.month];
if ([EMUtil isValidString: self.model.from]) {
if (!self.chooseFrom) {
//选择了开始时间再去选结束时间
NSDate *mindate = [dataFormant dateFromString:self.model.from];
NSDateComponents *mindateCom = [calendar components:unit fromDate:mindate];
datePicker.minimumDate = [NSDate setYear:mindateCom.year month:mindateCom.month];
}
}
if ([EMUtil isValidString: self.model.to]) {
if (self.chooseFrom) {
// 选择了结束时间再去选开始时间
NSDate *maxdate = [dataFormant dateFromString:self.model.to];
NSDateComponents *maxdateCom = [calendar components:unit fromDate:maxdate];
datePicker.maximumDate = [NSDate setYear:maxdateCom.year month:maxdateCom.month];
}
}
[datePicker show];
}
from pgdatepicker.
就是同时设置 datePicker.maximumDate 和 datePicker.minimumDate 会有问题。单独设置datePicker.maximumDate 是好的。
from pgdatepicker.
我设置同时设置过,我也一直在用,没有出现问题,你现在用的是版本多少,最新的是1.4.1
pod 'PGDatePicker', '>= 1.4.1'
你下载下demo,里面也有同时设置最小日期跟最大日期,也是没有问题的
from pgdatepicker.
可以的话,你留个QQ,我加你,帮你看看
from pgdatepicker.
demo里面我看了,当最大时间和最小时间是同一年的时候,就会出错。
- (IBAction)yearAndMonthHandler:(id)sender {
PGDatePicker *datePicker = [[PGDatePicker alloc]init];
datePicker.delegate = self;
[datePicker show];
datePicker.minimumDate = [NSDate setYear:2015 month:5];
datePicker.maximumDate = [NSDate setYear:2015 month:10];
datePicker.datePickerMode = PGDatePickerModeYearAndMonth;
}
from pgdatepicker.
Related Issues (20)
- 当系统的日历不为公历,即使在App中设置为公历,时间显示还是会错误
- 什么时候支持一下 AM PM
- 希望支持下xx年xx周
- 渲染很耗时 HOT 4
- 排查了代码 发现这里是这里很耗性能 : daysWithMonthInThisYear HOT 1
- 初始化加载的时候,CPU的消耗99%
- 自定义数据
- 设置在cell中,点击按钮调出一次,第二次调不出来了 HOT 1
- 数据没了
- 问题咨询 HOT 1
- 跨年显示问题
- cancel 和 sure 的内容改不了??点了sure按钮又没有回调??废了废了
- 想要只显示日时分可以吗
- 星期bug HOT 1
- 年月日中 day 显示不正确的问题,望修复
- 能否加上按周选择
- 在日期选择滚动的时候,能不能加上震动,就像系统的datePicker一样 HOT 1
- 自定义picker滚动会超出范围,会造成选中行空白
- - (NSInteger)howManyDaysWithMonthInThisYear:(NSInteger)year withMonth:(NSInteger)month 优化
- 希望增加一个几点到几点的选择
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 pgdatepicker.