Skip to content

Commit 57811cc

Browse files
millenomispevans
authored andcommitted
Implement DateIntervalFormatter.
(cherry picked from commit 988d5f8) Add the new files to the `CMakeLists.txt`s. (cherry picked from commit 0eed327) Fix boundary styles outside of Darwin. (cherry picked from commit ff070d6) Guard the tests as well. (cherry picked from commit 32cfcf1) Make tests fuzzier so they work on both Darwin and Linux ICUs. (cherry picked from commit b342e5f) Better assertion failure messages in the fuzzy matching. (cherry picked from commit 0c69d1a) Even more info. (cherry picked from commit e395327) Actually fix all the missed copy-paste changes after fuzzification. (cherry picked from commit 1600080)
1 parent 40f0d4a commit 57811cc

File tree

11 files changed

+958
-19
lines changed

11 files changed

+958
-19
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ if(ENABLE_TESTING)
382382
TestFoundation/TestCodable.swift
383383
TestFoundation/TestDateComponents.swift
384384
TestFoundation/TestDateFormatter.swift
385+
TestFoundation/TestDateIntervalFormatter.swift
385386
TestFoundation/TestDate.swift
386387
TestFoundation/TestDecimal.swift
387388
TestFoundation/TestEnergyFormatter.swift

CoreFoundation/Base.subproj/CFRuntime.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ static CFRuntimeClass const * __CFRuntimeClassTable[__CFRuntimeClassTableSize] _
213213
[_kCFRuntimeIDCFDateFormatter] = &__CFDateFormatterClass,
214214
[_kCFRuntimeIDCFNumberFormatter] = &__CFNumberFormatterClass,
215215
[_kCFRuntimeIDCFCalendar] = &__CFCalendarClass,
216+
[_kCFRuntimeIDCFDateIntervalFormatter] = &__CFDateIntervalFormatterClass,
216217
[_kCFRuntimeIDCFDate] = &__CFDateClass,
217218
[_kCFRuntimeIDCFTimeZone] = &__CFTimeZoneClass,
218219
[_kCFRuntimeIDCFKeyedArchiverUID] = &__CFKeyedArchiverUIDClass,

CoreFoundation/Base.subproj/CFRuntime_Internal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ enum {
7676
_kCFRuntimeIDCFSocket = 61,
7777
_kCFRuntimeIDCFAttributedString = 62,
7878
_kCFRuntimeIDCFRunArray = 63,
79+
_kCFRuntimeIDCFDateIntervalFormatter = 64,
7980
// If you are adding a new value, it goes below this line.
8081

8182
// Stuff not in CF goes here. This value should be one more than the last one above.
@@ -124,7 +125,6 @@ CF_PRIVATE const CFRuntimeClass __CFPreferencesDomainClass;
124125

125126
CF_PRIVATE const CFRuntimeClass __CFMachPortClass;
126127

127-
128128
#if (TARGET_OS_MAC || TARGET_OS_WIN32 || DEPLOYMENT_RUNTIME_SWIFT)
129129
CF_PRIVATE const CFRuntimeClass __CFMessagePortClass;
130130
#endif
@@ -143,6 +143,7 @@ CF_PRIVATE const CFRuntimeClass __CFWindowsNamedPipeClass;
143143
#endif
144144
CF_PRIVATE const CFRuntimeClass __CFTimeZoneClass;
145145
CF_PRIVATE const CFRuntimeClass __CFCalendarClass;
146+
CF_PRIVATE const CFRuntimeClass __CFDateIntervalFormatterClass;
146147

147148
#pragma mark - Private initialiers to run at process start time
148149

CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <CoreFoundation/CFRegularExpression.h>
2525
#include <CoreFoundation/CFLogUtilities.h>
2626
#include <CoreFoundation/CFURLSessionInterface.h>
27+
#include <CoreFoundation/CFDateIntervalFormatter.h>
2728
#include <CoreFoundation/ForFoundationOnly.h>
2829
#if DEPLOYMENT_TARGET_WINDOWS
2930
#define NOMINMAX

CoreFoundation/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ add_framework(CoreFoundation
7878
Locale.subproj/CFCalendar_Internal.h
7979
Locale.subproj/CFDateComponents.h
8080
Locale.subproj/CFDateFormatter_Private.h
81+
Locale.subproj/CFDateIntervalFormatter.h
8182
Locale.subproj/CFDateInterval.h
8283
Locale.subproj/CFICULogging.h
8384
Locale.subproj/CFLocaleInternal.h
@@ -144,6 +145,7 @@ add_framework(CoreFoundation
144145
StringEncodings.subproj/CFStringEncodingConverterExt.h
145146
URL.subproj/CFURLPriv.h
146147
URL.subproj/CFURLSessionInterface.h
148+
Locale.subproj/CFDateIntervalFormatter.h
147149

148150
# AppServices
149151
AppServices.subproj/CFNotificationCenter.h
@@ -232,6 +234,7 @@ add_framework(CoreFoundation
232234
Locale.subproj/CFCalendar_Enumerate.c
233235
Locale.subproj/CFDateComponents.c
234236
Locale.subproj/CFDateFormatter.c
237+
Locale.subproj/CFDateIntervalFormatter.c
235238
Locale.subproj/CFDateInterval.c
236239
Locale.subproj/CFLocale.c
237240
Locale.subproj/CFLocaleIdentifier.c

0 commit comments

Comments
 (0)