Search results for

calendar

1,868 results found

Post

Replies

Boosts

Views

Activity

Reply to String inerpolation issue using swift 5...
I'm saving the last n log messages in user defaults as a means of tracing crashes. The log data includes a string that has an interpolated call to a function that returns a formatted time string. When I retrieve it later after a cold start by the app, I'm seeing the current time displayed rather than the time the log entry was saved. Interesting. Thanks for sharing the code. There must be something else going on here as I am not able to reproduce this with the code you've provided with UserDefaults. Running this brief example: class BaseTimeSupport { static func formatDateTime(_ date: Date, usingFormat: String = MM/dd/yyyy HH:mm:ss) -> String { let dateFormatter = DateFormatter() dateFormatter.locale = .current dateFormatter.dateFormat = usingFormat dateFormatter.calendar = Calendar(identifier: .gregorian) return dateFormatter.string(from: date) } } let defaults = UserDefaults.standard var logs: [String] = [] if let logArray = defaults.object(forKey: Logs) as? [String] { logs = logArray print(Curr
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’22
Reply to String inerpolation issue using swift 5...
This is the exact code being used. this is the where I'm getting the time stamp, message is a text string let messageToLog = (BaseTimeSupport.formatDateTime(.now)) - (message) this is the time stamp formatter static func formatDateTime(_ date: Date, usingFormat: String = MM/dd/yyyy HH:mm:ss) -> String { let dateFormatter = DateFormatter() dateFormatter.locale = .current dateFormatter.dateFormat = usingFormat dateFormatter.calendar = Calendar(identifier: .gregorian) return dateFormatter.string(from: date) }
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’22
Reply to DateComponentsFormatter formatted string is not working as expected
It seems that defining a timezone helps to handle the daylight savning as you can see. let formatter = DateComponentsFormatter() var calendar = Calendar.current calendar.timeZone = TimeZone(identifier: America/Toronto) ?? .current formatter.allowedUnits = [.day, .hour, .minute] formatter.unitsStyle = .abbreviated formatter.zeroFormattingBehavior = .dropAll formatter.maximumUnitCount = 3 formatter.collapsesLargestUnit = false formatter.calendar = calendar return formatter }() let durationShortAbidjan: DateComponentsFormatter = { let formatter = DateComponentsFormatter() var calendar = Calendar.current calendar.timeZone = TimeZone(identifier: Africa/Abidjan) ?? .current formatter.allowedUnits = [.day, .hour, .minute] formatter.unitsStyle = .abbreviated formatter.zeroFormattingBehavior = .dropAll formatter.maximumUnitCount = 3 formatter.collapsesLargestUnit = false formatter.calendar = calendar return formatter }() let durationShortTokyo: DateComponentsFormatter = { let format
Topic: App & System Services SubTopic: General Tags:
Feb ’22
Reply to iOS 15.4 Beta 12-Hour Time dateFromString nil
We have tested pin the locale to en_US_POSIX, It did solve our problem. Yay! I wonder, the iOS version befroe 15.4 need not to add this. They did, you just didn’t discover that in your testing. For example, if you had tested on a device with the current locale set to the Buddhist calendar, you would have noticed a problem immediately [1]. As to why 15.4 caused you to notice this, it’s hard to say. The default locale settings change frequently, and it seems that one of those changes has intersected with your test matrix so that you’ve now notice the problem. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] I once helped an Australian bank debug a problem where their dates were off by about 500 years, but only for a small subset of their customers who happened to all live in Thailand. It seems that those customers had selected the Buddhist calendar, and were triggering exactly this issue.
Topic: App & System Services SubTopic: General Tags:
Feb ’22
Mac mini m1 restarting, no support in europe.
Monterey 12.2.1 using no usb devices connected. OS reinstalled, smc all the reset performed. I paid more than 1000 euron need answers, I cannot connect support because Apple not offering support for people with hearing difficulties in Europe. It is a hardware or software issue?????? panic(cpu 3 caller 0xfffffe002c3a0be0): [data.kalloc.16]: element modified after free (off:0, val:0x0000000000000230, sz:16, ptr:0xfffffe299a3188a0) 0: 0x0000000000000230 Debugger message: panic Memory ID: 0x6 OS release type: User OS version: 21D62 Kernel version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 Fileset Kernelcache UUID: 7C53FB49FDE6F710235278E472070819 Kernel UUID: F5893147-A9D2-3D60-B5A4-E4AE9BA0A628 iBoot version: iBoot-7429.81.3 secure boot?: YES Paniclog version: 13 KernelCache slide: 0x000000002421c000 KernelCache base: 0xfffffe002b220000 Kernel slide: 0x0000000024a4c000 Kernel text base: 0xfffffe002ba50000 Kernel text exec slide: 0x0000000024b34000 Kerne
2
0
531
Feb ’22
Reply to Kernel panic on Macbook Air
I have the same issue - this happens when I have open applications and the computer hibernates... iMac Mini M1 4 months old... VERY VERY FRUSTRATING!!! panic(cpu 1 caller 0xfffffe0028e66cbc): watchdog timeout: no checkins from watchdogd in 93 seconds (15 total checkins since monitoring last enabled) Debugger message: panic Memory ID: 0xff OS release type: User OS version: 21C52 Kernel version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 Fileset Kernelcache UUID: 0BB1D99520DD8B6DD172990B62E25173 Kernel UUID: 45FC3A32-3BC5-3F88-9300-71FBEF05D092 iBoot version: iBoot-7429.61.2 secure boot?: YES Paniclog version: 13 KernelCache slide: 0x0000000020b30000 KernelCache base: 0xfffffe0027b34000 Kernel slide: 0x000000002135c000 Kernel text base: 0xfffffe0028360000 Kernel text exec slide: 0x0000000021444000 Kernel text exec base: 0xfffffe0028448000 mach_absolute_time: 0x28393fbcd58 Epoch Time: sec usec Boot : 0x61f6ba1e 0x0007d668 Sleep : 0x61fc0675 0x0006dbc4 Wak
Topic: App & System Services SubTopic: Hardware Tags:
Feb ’22
Create subscription calendar cal.ical from my app with url
Hello, In the calendar app people can subscribe to calendars from the web and have the events in the calendar, but can my Xcode app generate a local url with an ical file that can be subscribed to? Just for the user on the device with the app, not on the internet? For example my app when run creates an ical file of events that repeat each year, like international days of the year and puts it somewhere like in the group folder or somewhere behind the scenes and then the user can click that link from within the app or copy and past it into the calendar app by adding a new calendar and putting in the url? I don't want to put the url online because the information is private and just for the user of the device.
1
0
1.6k
Feb ’22
CoreData FetchRequest doesn't update view
I have an app that lets users log drinks. Users create CoreData entries that have attributes like drink type and quantity. I have a view that lets users the quantity they have consumed in the current day. This is done using a FetchRequest and a calendar predicate that only fetches entries from the current day. I am using @FetchRequest property wrapper in the view, then initializing it with init() {}. Inside the initializer, I set the predicate, sort descriptors, and use self._todayIntakeEvents ... to set the value for the fetch request variable. Then, each time the view appears, I use .onAppear to sum the quantity of the fetched items by using todayIntakeEvents.map, then using .reduce to sum the array. The problem: when users add drinks with Siri, the drink information doesn't show up when opening the app from background. However, it will appear if I quit and relaunch the app. What I want to happen is for the drink to appear immediately when the user opens the app again. My code for the view: struct
1
0
1.2k
Jan ’22
Reply to Kernel panic on Macbook Air
Having a similar problem panic(cpu 0 caller 0xfffffe001d043f48): hibernate_write_image encountered error 0xe00002e8 - 103371, 92994, 0, 6533, 10, 0, 4, 5, 0, 0, 0, 0, 0, 0 @vm_compressor.c:4906 Debugger message: panic Memory ID: 0x6 OS release type: User OS version: 21C52 Kernel version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 Fileset Kernelcache UUID: 88208EF24C07AA8B02CDA1369E036EBD Kernel UUID: 2F4E22DC-64BE-3369-B574-0909F0571FA6 iBoot version: iBoot-7429.61.2 secure boot?: YES Paniclog version: 13 KernelCache slide: 0x0000000015644000 KernelCache base: 0xfffffe001c648000 Kernel slide: 0x0000000015e70000 Kernel text base: 0xfffffe001ce74000 Kernel text exec slide: 0x0000000015f58000 Kernel text exec base: 0xfffffe001cf5c000 mach_absolute_time: 0x83f386dd20 Epoch Time: sec usec Boot : 0x61ebe850 0x00003b3f Sleep : 0x61ec4b7c 0x000c3aaa Wake : 0x00000000 0x00000000 Calendar: 0x61ec4b87 0x00088e7d Zone info: Foreign : 0xfffffe0025c30000 -
Topic: App & System Services SubTopic: Hardware Tags:
Jan ’22
Reply to Create a calendar event with an attached file?
Sorry, I will put the complete script here. I think this way you can better understand my question: tell application FileMaker Pro activate set theStartDate to field Fecha intervencion of current record end tell set theEndDate to theStartDate set DateStart_text to date theStartDate set DateEnd_text to date theEndDate set HoraStart_Text to 0 set HoraEnd_Text to 0 set Dia_Txt to (DateStart_text & & HoraStart_Text) as string set Dia to date Dia_Txt set Dia_Fin_Txt to (DateEnd_text & & HoraEnd_Text) as string set Dia_Fin to date Dia_Fin_Txt set v_Desc to Varices láser MID. asisa. Doy todo. set v_Summary to PROBANDO PRUEBA PROBAR set v_Desc_text to v_Desc as string set v_Summary_text to v_Summary as string set theStartDate_text to date theStartDate set theEndDate_text to date theEndDate **set Thefile to /Users/sergio/Desktop/Temporal FMK/Prueba Probar , Probando.pdf** tell application Calendar tell calendar trabajo sergi set NewEvent to make new event with properties {summary:
Topic: App & System Services SubTopic: General Tags:
Jan ’22
Create a calendar event with an attached file?
Hi, I've been trying to create an event with an attached file (a pdf in my case). At the moment I would have the following: set NewEvent to make new event with properties {summary:OR, start date:Dia, end date:Dia_fin, } I need the property which would be followed by the file route, I have tried with url but it obviously doesn't work. Thank you very much.
1
0
839
Jan ’22
Reply to Cannot dismiss date pickers in iOS 11.3.1 in UI automated tests
I am declaring a DatePicker in a SwiftUI view in my app as follows: DatePicker(Date Selected, selection: $selectedDate, displayedComponents: [.date]) .accessibilityIdentifier(DatePicker) .datePickerStyle(.compact) After many wasted hours, I have managed to write a UI test which taps on the DatePicker to reveal the calendar-style popup, chooses the desired date in the popup and then dismisses the popup, as follows: // 1. Show the DatePicker popup application.datePickers[DatePicker].tap() // 2. Choose a date in the popup application.datePickers.collectionViews.buttons[Friday, January 14].tap() // 3. Dismiss the DatePicker popup application.datePickers[DatePicker].tap() This is working for me on iOS 15.2 devices. I have put together a minimal SwiftUI app which demonstrates this here.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’22