<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDatePickerCellDelegate/datePickerCell(_:validateProposedDateValue:timeInterval:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSDatePickerCellDelegate(im)datePickerCell:validateProposedDateValue:timeInterval:"
  },
  "title" : "datePickerCell(_:validateProposedDateValue:timeInterval:)"
}
-->

# datePickerCell(_:validateProposedDateValue:timeInterval:)

The delegate receives this message each time the user attempts to change the receiver’s value, allowing the delegate the opportunity to override the change.

```
@MainActor optional func datePickerCell(_ datePickerCell: NSDatePickerCell, validateProposedDateValue proposedDateValue: AutoreleasingUnsafeMutablePointer<NSDate>, timeInterval proposedTimeInterval: UnsafeMutablePointer<TimeInterval>?)
```

## Parameters

`datePickerCell`

The cell that sent the message.

`proposedDateValue`

On input, contains the proposed new date. The delegate may change this value before returning.

`proposedTimeInterval`

On input, contains the proposed new time interval. The delegate may change this value before returning.

## Discussion

When returning a new `proposedDateValue`, the `NSDate` instance should be autoreleased, and the `proposedDateValue` should not be released by the delegate.

The `proposedDateValue` and `proposedTimeInterval` are guaranteed to lie between the dates returned by [`minDate`](/documentation/AppKit/NSDatePickerCell/minDate) and [`maxDate`](/documentation/AppKit/NSDatePickerCell/maxDate). If you modify these values, you should ensure that the new values are within the appropriate range.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)