Questions tagged [nsdatepicker]

NSDatePicker is a subclass of NSControl that provides a user interface for displaying and editing an NSDate object.

NSDatePicker is a subclass of NSControl that provides a user interface for displaying and editing an NSDate object.

NSDatePicker uses an NSDatePickerCell to implement much of the control’s functionality. NSDatePicker provides cover methods for most of NSDatePickerCell methods, which invoke the corresponding cell method

90 questions
61
votes
12 answers

Minimum and maximum date in UIDatePicker

I want to get the minimum and maximum date from a date picker, but minimum date should be "- 18" of the current date and the maximum date should be "- 100" of current date. Suppose current year is 2018 then I want minimum date 2000 and maximum date…
NSException
  • 1,268
  • 3
  • 14
  • 28
35
votes
8 answers

Is caching a NSDateformatter application-wide good idea?

It's well known that creating NSDateFormatters is 'expensive' Even Apple's Data Formatting Guide (updated 2014-02) states: Creating a date formatter is not a cheap operation. If you are likely to use a formatter frequently, it is typically more…
Tieme
  • 62,602
  • 20
  • 102
  • 156
15
votes
7 answers

Set NSDate 0 seconds in swift

I'm trying to get NSDate from UIDatePicker, but it constantly returns me a date time with trailing 20 seconds. How can I manually set NSDate's second to zero in swift?
aftab ahmed
  • 181
  • 1
  • 1
  • 6
9
votes
1 answer

NSDatePicker in NSStatusBar NSSMenuItem not receiving input

A while back I wrote a simple calendar menu bar widget called Day-O. The calendar uses the stock NSDatePicker nested inside an NSView inside an NSMenuItem in an NSMenu added to an NSStatusItem. The app has an activationPolicy of .accessory…
Shaun Inman
  • 1,968
  • 1
  • 19
  • 28
6
votes
3 answers

NSDatePicker - getting the value when it is changed

How would I get notified of a value of a NSDatePicker, when it's changed?
nanochrome
  • 707
  • 2
  • 12
  • 26
5
votes
1 answer

NSDatePicker timezone weirdness

I have an NSDatePicker in my nib file. In code, I set it's timezone to be the GMT calendar's timezone: [datePicker setTimeZone:[calendar timeZone]]; I only really care about the time (hours, minutes) on the datepicker which I populate…
JPC
  • 8,096
  • 22
  • 77
  • 110
5
votes
3 answers

NSDatePicker change date method runs twice!(mac app)

I just add one NSDatePicker to the form, set the style graphical, and set the action like this: [datePicker setAction:@selector(datePickSelected:)]; in the method, it just prints out the selected date. -(void)datePickSelected:(id)sender { …
vincent
  • 113
  • 8
5
votes
2 answers

UIDatePicker minus the exact time - Swift

I'm making an alarm clock where it will tell you how many hours and minutes of sleep you get. I set up a UIDatePicker where the user chooses what time they wanna wake up. It also tells the exact time to the very second. The part that I'm stuck on is…
alex
  • 1,746
  • 6
  • 19
  • 34
5
votes
1 answer

NSDatePicker action method not firing

Scenario: The user is entering a date in an NSDatePicker in its textual form with no stepper (on OS X), and when they hit return on the keyboard, I'd like a message to be sent to the controller. In an NSTextField, I would just hook the action up in…
Monolo
  • 18,205
  • 17
  • 69
  • 103
4
votes
0 answers

NSDatePicker set day colour

I use NSDatePicker in my application. How can I set green color for 15th and 21st October and orange color for 17th October?
Kirill
  • 1,412
  • 4
  • 21
  • 45
3
votes
3 answers

empty NSDatePicker

Hi Is it possible to have a NSDatePicker representing a nil object? Something like -/-/- or any other way. Thanks, Radu
Radu Paise
  • 285
  • 1
  • 6
  • 16
3
votes
4 answers

Setting up NSDatePicker delegate

I have a NSDatePicker (NSDatePicker* datePicker), and set its delegate as the main application (self). I programmed as follows. Make self datePicker delegate [[datePicker cell] setDelegate:self]; Set datePickerAction: to be called when control is…
prosseek
  • 182,215
  • 215
  • 566
  • 871
3
votes
2 answers

Get Hours and Minutes from NSDatePicker - Swift

Hi so i making something where a user enters a TIME into NSDatePicker so i can get the value and store it into a string for later use. I have connected the date picker with an outlet and im trying to get the value to export with no luck! Please…
Eli
  • 668
  • 2
  • 13
  • 37
3
votes
3 answers

NSDatePicker alternative

one of my OS X apps deals with various dates. The user has to enter dates at many different places and most of the dates are not around the current date but somewhere in the past. NSDatePicker (in graphical mode) offers a very limited UI: It is not…
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
2
votes
2 answers

How can convert date into "dd/MM/yyyy" format?

In my app I am using date picker & show date in textfield, Date picker given me a date in this format "Mar 1, 2012" I want that date in "dd/MM/yyyy" format. how can i do that?
Anki
  • 589
  • 2
  • 13
  • 22
1
2 3 4 5 6