Skip to content

最终显示的数值有误 #2

Description

@ZNLHH

在自定义DatePicker中

    // 自定义:最大最小日期格式
    if (type == BAKit_CustomDatePickerDateTypeYMD)
    {
        NSDateFormatter *format = [NSDateFormatter ba_setupDateFormatterWithYMD];
        NSDate *today = [[NSDate alloc]init];
        [format setDateFormat:@"yyyy-MM-dd"];
        
        // 最小时间,当前时间
        mindDate = [format dateFromString:[format stringFromDate:today]];
        
        NSTimeInterval oneDay = 24 * 60 * 60;
        // 最大时间,当前时间+180天
        NSDate *theDay = [today initWithTimeIntervalSinceNow:oneDay * 180];
        maxdDate = [format dateFromString:[format stringFromDate:theDay]];
        
    }

如果我仅滑动年份,最终显示的时间超出我设置的时间

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions