blob: 775b4caf390d677e5fc7d8cd9dc7a6b5a01d87a8 [file] [log] [blame]
Fredrik Roubert0596fae2017-04-18 21:34:02 +02001// © 2016 and later: Unicode, Inc. and others.
Fredrik Roubert64339d32016-10-21 19:43:16 +02002// License & terms of use: http://www.unicode.org/copyright.html
Fredrik Roubert8de051c2016-03-10 13:13:27 +01003/*
4*****************************************************************************************
5* Copyright (C) 2016, International Business Machines
6* Corporation and others. All Rights Reserved.
7*****************************************************************************************
8*/
9
10#ifndef URELDATEFMT_H
11#define URELDATEFMT_H
12
13#include "unicode/utypes.h"
14
15#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
16
17#include "unicode/unum.h"
18#include "unicode/udisplaycontext.h"
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +010019#include "unicode/uformattedvalue.h"
Fredrik Roubert8de051c2016-03-10 13:13:27 +010020
Victor Changeaf32ab2020-08-20 15:50:49 +010021#if U_SHOW_CPLUSPLUS_API
22#include "unicode/localpointer.h"
23#endif // U_SHOW_CPLUSPLUS_API
24
Fredrik Roubert8de051c2016-03-10 13:13:27 +010025/**
26 * \file
27 * \brief C API: URelativeDateTimeFormatter, relative date formatting of unit + numeric offset.
28 *
29 * Provides simple formatting of relative dates, in two ways
30 * <ul>
31 * <li>relative dates with a quantity e.g "in 5 days"</li>
32 * <li>relative dates without a quantity e.g "next Tuesday"</li>
33 * </ul>
34 * <p>
35 * This does not provide compound formatting for multiple units,
36 * other than the ability to combine a time string with a relative date,
37 * as in "next Tuesday at 3:45 PM". It also does not provide support
38 * for determining which unit to use, such as deciding between "in 7 days"
39 * and "in 1 week".
40 *
Fredrik Roubert0596fae2017-04-18 21:34:02 +020041 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +010042 */
43
44/**
45 * The formatting style
46 * @stable ICU 54
47 */
48typedef enum UDateRelativeDateTimeFormatterStyle {
49 /**
50 * Everything spelled out.
51 * @stable ICU 54
52 */
53 UDAT_STYLE_LONG,
54
55 /**
56 * Abbreviations used when possible.
57 * @stable ICU 54
58 */
59 UDAT_STYLE_SHORT,
60
61 /**
62 * Use the shortest possible form.
63 * @stable ICU 54
64 */
65 UDAT_STYLE_NARROW,
66
Fredrik Roubert64339d32016-10-21 19:43:16 +020067#ifndef U_HIDE_DEPRECATED_API
68 /**
69 * One more than the highest normal UDateRelativeDateTimeFormatterStyle value.
70 * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
71 */
72 UDAT_STYLE_COUNT
Fredrik Roubert0596fae2017-04-18 21:34:02 +020073#endif /* U_HIDE_DEPRECATED_API */
Fredrik Roubert8de051c2016-03-10 13:13:27 +010074} UDateRelativeDateTimeFormatterStyle;
75
Fredrik Roubert8de051c2016-03-10 13:13:27 +010076/**
77 * Represents the unit for formatting a relative date. e.g "in 5 days"
78 * or "next year"
Fredrik Roubert0596fae2017-04-18 21:34:02 +020079 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +010080 */
81typedef enum URelativeDateTimeUnit {
82 /**
83 * Specifies that relative unit is year, e.g. "last year",
84 * "in 5 years".
Fredrik Roubert0596fae2017-04-18 21:34:02 +020085 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +010086 */
87 UDAT_REL_UNIT_YEAR,
88 /**
89 * Specifies that relative unit is quarter, e.g. "last quarter",
90 * "in 5 quarters".
Fredrik Roubert0596fae2017-04-18 21:34:02 +020091 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +010092 */
93 UDAT_REL_UNIT_QUARTER,
94 /**
95 * Specifies that relative unit is month, e.g. "last month",
96 * "in 5 months".
Fredrik Roubert0596fae2017-04-18 21:34:02 +020097 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +010098 */
99 UDAT_REL_UNIT_MONTH,
100 /**
101 * Specifies that relative unit is week, e.g. "last week",
102 * "in 5 weeks".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200103 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100104 */
105 UDAT_REL_UNIT_WEEK,
106 /**
107 * Specifies that relative unit is day, e.g. "yesterday",
108 * "in 5 days".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200109 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100110 */
111 UDAT_REL_UNIT_DAY,
112 /**
113 * Specifies that relative unit is hour, e.g. "1 hour ago",
114 * "in 5 hours".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200115 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100116 */
117 UDAT_REL_UNIT_HOUR,
118 /**
119 * Specifies that relative unit is minute, e.g. "1 minute ago",
120 * "in 5 minutes".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200121 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100122 */
123 UDAT_REL_UNIT_MINUTE,
124 /**
125 * Specifies that relative unit is second, e.g. "1 second ago",
126 * "in 5 seconds".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200127 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100128 */
129 UDAT_REL_UNIT_SECOND,
130 /**
131 * Specifies that relative unit is Sunday, e.g. "last Sunday",
132 * "this Sunday", "next Sunday", "in 5 Sundays".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200133 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100134 */
135 UDAT_REL_UNIT_SUNDAY,
136 /**
137 * Specifies that relative unit is Monday, e.g. "last Monday",
138 * "this Monday", "next Monday", "in 5 Mondays".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200139 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100140 */
141 UDAT_REL_UNIT_MONDAY,
142 /**
143 * Specifies that relative unit is Tuesday, e.g. "last Tuesday",
144 * "this Tuesday", "next Tuesday", "in 5 Tuesdays".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200145 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100146 */
147 UDAT_REL_UNIT_TUESDAY,
148 /**
149 * Specifies that relative unit is Wednesday, e.g. "last Wednesday",
150 * "this Wednesday", "next Wednesday", "in 5 Wednesdays".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200151 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100152 */
153 UDAT_REL_UNIT_WEDNESDAY,
154 /**
155 * Specifies that relative unit is Thursday, e.g. "last Thursday",
156 * "this Thursday", "next Thursday", "in 5 Thursdays".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200157 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100158 */
159 UDAT_REL_UNIT_THURSDAY,
160 /**
161 * Specifies that relative unit is Friday, e.g. "last Friday",
162 * "this Friday", "next Friday", "in 5 Fridays".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200163 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100164 */
165 UDAT_REL_UNIT_FRIDAY,
166 /**
167 * Specifies that relative unit is Saturday, e.g. "last Saturday",
168 * "this Saturday", "next Saturday", "in 5 Saturdays".
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200169 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100170 */
171 UDAT_REL_UNIT_SATURDAY,
Fredrik Roubert64339d32016-10-21 19:43:16 +0200172#ifndef U_HIDE_DEPRECATED_API
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100173 /**
Fredrik Roubert64339d32016-10-21 19:43:16 +0200174 * One more than the highest normal URelativeDateTimeUnit value.
175 * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100176 */
177 UDAT_REL_UNIT_COUNT
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200178#endif /* U_HIDE_DEPRECATED_API */
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100179} URelativeDateTimeUnit;
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100180
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +0100181#ifndef U_HIDE_DRAFT_API
182/**
183 * FieldPosition and UFieldPosition selectors for format fields
184 * defined by RelativeDateTimeFormatter.
185 * @draft ICU 64
186 */
187typedef enum URelativeDateTimeFormatterField {
188 /**
189 * Represents a literal text string, like "tomorrow" or "days ago".
190 * @draft ICU 64
191 */
192 UDAT_REL_LITERAL_FIELD,
193 /**
194 * Represents a number quantity, like "3" in "3 days ago".
195 * @draft ICU 64
196 */
197 UDAT_REL_NUMERIC_FIELD,
198} URelativeDateTimeFormatterField;
199#endif // U_HIDE_DRAFT_API
200
201
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100202/**
203 * Opaque URelativeDateTimeFormatter object for use in C programs.
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200204 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100205 */
206struct URelativeDateTimeFormatter;
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200207typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C typedef for struct URelativeDateTimeFormatter. @stable ICU 57 */
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100208
209
210/**
211 * Open a new URelativeDateTimeFormatter object for a given locale using the
212 * specified width and capitalizationContext, along with a number formatter
213 * (if desired) to override the default formatter that would be used for
214 * display of numeric field offsets. The default formatter typically rounds
215 * toward 0 and has a minimum of 0 fraction digits and a maximum of 3
216 * fraction digits (i.e. it will show as many decimal places as necessary
217 * up to 3, without showing trailing 0s).
218 *
219 * @param locale
220 * The locale
221 * @param nfToAdopt
222 * A number formatter to set for this URelativeDateTimeFormatter
223 * object (instead of the default decimal formatter). Ownership of
224 * this UNumberFormat object will pass to the URelativeDateTimeFormatter
225 * object (the URelativeDateTimeFormatter adopts the UNumberFormat),
226 * which becomes responsible for closing it. If the caller wishes to
227 * retain ownership of the UNumberFormat object, the caller must clone
228 * it (with unum_clone) and pass the clone to ureldatefmt_open. May be
229 * NULL to use the default decimal formatter.
230 * @param width
231 * The width - wide, short, narrow, etc.
232 * @param capitalizationContext
233 * A value from UDisplayContext that pertains to capitalization, e.g.
234 * UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE.
235 * @param status
236 * A pointer to a UErrorCode to receive any errors.
237 * @return
238 * A pointer to a URelativeDateTimeFormatter object for the specified locale,
239 * or NULL if an error occurred.
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200240 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100241 */
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200242U_STABLE URelativeDateTimeFormatter* U_EXPORT2
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100243ureldatefmt_open( const char* locale,
244 UNumberFormat* nfToAdopt,
245 UDateRelativeDateTimeFormatterStyle width,
246 UDisplayContext capitalizationContext,
247 UErrorCode* status );
248
249/**
250 * Close a URelativeDateTimeFormatter object. Once closed it may no longer be used.
251 * @param reldatefmt
252 * The URelativeDateTimeFormatter object to close.
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200253 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100254 */
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200255U_STABLE void U_EXPORT2
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100256ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt);
257
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +0100258#ifndef U_HIDE_DRAFT_API
259struct UFormattedRelativeDateTime;
260/**
261 * Opaque struct to contain the results of a URelativeDateTimeFormatter operation.
262 * @draft ICU 64
263 */
264typedef struct UFormattedRelativeDateTime UFormattedRelativeDateTime;
265
266/**
267 * Creates an object to hold the result of a URelativeDateTimeFormatter
268 * operation. The object can be used repeatedly; it is cleared whenever
269 * passed to a format function.
270 *
271 * @param ec Set if an error occurs.
272 * @return A pointer needing ownership.
273 * @draft ICU 64
274 */
275U_DRAFT UFormattedRelativeDateTime* U_EXPORT2
276ureldatefmt_openResult(UErrorCode* ec);
277
278/**
279 * Returns a representation of a UFormattedRelativeDateTime as a UFormattedValue,
280 * which can be subsequently passed to any API requiring that type.
281 *
282 * The returned object is owned by the UFormattedRelativeDateTime and is valid
283 * only as long as the UFormattedRelativeDateTime is present and unchanged in memory.
284 *
285 * You can think of this method as a cast between types.
286 *
287 * @param ufrdt The object containing the formatted string.
288 * @param ec Set if an error occurs.
289 * @return A UFormattedValue owned by the input object.
290 * @draft ICU 64
291 */
292U_DRAFT const UFormattedValue* U_EXPORT2
293ureldatefmt_resultAsValue(const UFormattedRelativeDateTime* ufrdt, UErrorCode* ec);
294
295/**
296 * Releases the UFormattedRelativeDateTime created by ureldatefmt_openResult.
297 *
298 * @param ufrdt The object to release.
299 * @draft ICU 64
300 */
301U_DRAFT void U_EXPORT2
302ureldatefmt_closeResult(UFormattedRelativeDateTime* ufrdt);
303#endif /* U_HIDE_DRAFT_API */
304
305
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100306#if U_SHOW_CPLUSPLUS_API
307
308U_NAMESPACE_BEGIN
309
310/**
311 * \class LocalURelativeDateTimeFormatterPointer
312 * "Smart pointer" class, closes a URelativeDateTimeFormatter via ureldatefmt_close().
313 * For most methods see the LocalPointerBase base class.
314 *
315 * @see LocalPointerBase
316 * @see LocalPointer
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200317 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100318 */
319U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close);
320
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +0100321#ifndef U_HIDE_DRAFT_API
322/**
323 * \class LocalUFormattedRelativeDateTimePointer
324 * "Smart pointer" class, closes a UFormattedRelativeDateTime via ureldatefmt_closeResult().
325 * For most methods see the LocalPointerBase base class.
326 *
327 * @see LocalPointerBase
328 * @see LocalPointer
329 * @draft ICU 64
330 */
331U_DEFINE_LOCAL_OPEN_POINTER(LocalUFormattedRelativeDateTimePointer, UFormattedRelativeDateTime, ureldatefmt_closeResult);
332#endif /* U_HIDE_DRAFT_API */
333
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100334U_NAMESPACE_END
335
336#endif
337
338/**
339 * Format a combination of URelativeDateTimeUnit and numeric
340 * offset using a numeric style, e.g. "1 week ago", "in 1 week",
341 * "5 weeks ago", "in 5 weeks".
342 *
343 * @param reldatefmt
344 * The URelativeDateTimeFormatter object specifying the
345 * format conventions.
346 * @param offset
347 * The signed offset for the specified unit. This will
348 * be formatted according to this object's UNumberFormat
349 * object.
350 * @param unit
351 * The unit to use when formatting the relative
352 * date, e.g. UDAT_REL_UNIT_WEEK, UDAT_REL_UNIT_FRIDAY.
353 * @param result
354 * A pointer to a buffer to receive the formatted result.
355 * @param resultCapacity
356 * The maximum size of result.
357 * @param status
358 * A pointer to a UErrorCode to receive any errors. In
359 * case of error status, the contents of result are
360 * undefined.
361 * @return
362 * The length of the formatted result; may be greater
363 * than resultCapacity, in which case an error is returned.
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200364 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100365 */
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200366U_STABLE int32_t U_EXPORT2
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100367ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
368 double offset,
369 URelativeDateTimeUnit unit,
370 UChar* result,
371 int32_t resultCapacity,
372 UErrorCode* status);
373
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +0100374#ifndef U_HIDE_DRAFT_API
375/**
376 * Format a combination of URelativeDateTimeUnit and numeric
377 * offset using a numeric style, e.g. "1 week ago", "in 1 week",
378 * "5 weeks ago", "in 5 weeks".
379 *
380 * @param reldatefmt
381 * The URelativeDateTimeFormatter object specifying the
382 * format conventions.
383 * @param offset
384 * The signed offset for the specified unit. This will
385 * be formatted according to this object's UNumberFormat
386 * object.
387 * @param unit
388 * The unit to use when formatting the relative
389 * date, e.g. UDAT_REL_UNIT_WEEK, UDAT_REL_UNIT_FRIDAY.
390 * @param result
391 * A pointer to a UFormattedRelativeDateTime to populate.
392 * @param status
393 * A pointer to a UErrorCode to receive any errors. In
394 * case of error status, the contents of result are
395 * undefined.
396 * @draft ICU 64
397 */
398U_DRAFT void U_EXPORT2
399ureldatefmt_formatNumericToResult(
400 const URelativeDateTimeFormatter* reldatefmt,
401 double offset,
402 URelativeDateTimeUnit unit,
403 UFormattedRelativeDateTime* result,
404 UErrorCode* status);
405#endif /* U_HIDE_DRAFT_API */
406
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100407/**
408 * Format a combination of URelativeDateTimeUnit and numeric offset
409 * using a text style if possible, e.g. "last week", "this week",
410 * "next week", "yesterday", "tomorrow". Falls back to numeric
411 * style if no appropriate text term is available for the specified
412 * offset in the object's locale.
413 *
414 * @param reldatefmt
415 * The URelativeDateTimeFormatter object specifying the
416 * format conventions.
417 * @param offset
418 * The signed offset for the specified unit.
419 * @param unit
420 * The unit to use when formatting the relative
421 * date, e.g. UDAT_REL_UNIT_WEEK, UDAT_REL_UNIT_FRIDAY.
422 * @param result
423 * A pointer to a buffer to receive the formatted result.
424 * @param resultCapacity
425 * The maximum size of result.
426 * @param status
427 * A pointer to a UErrorCode to receive any errors. In
428 * case of error status, the contents of result are
429 * undefined.
430 * @return
431 * The length of the formatted result; may be greater
432 * than resultCapacity, in which case an error is returned.
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200433 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100434 */
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200435U_STABLE int32_t U_EXPORT2
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100436ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
437 double offset,
438 URelativeDateTimeUnit unit,
439 UChar* result,
440 int32_t resultCapacity,
441 UErrorCode* status);
442
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +0100443#ifndef U_HIDE_DRAFT_API
444/**
445 * Format a combination of URelativeDateTimeUnit and numeric offset
446 * using a text style if possible, e.g. "last week", "this week",
447 * "next week", "yesterday", "tomorrow". Falls back to numeric
448 * style if no appropriate text term is available for the specified
449 * offset in the object's locale.
450 *
451 * This method populates a UFormattedRelativeDateTime, which exposes more
452 * information than the string populated by format().
453 *
454 * @param reldatefmt
455 * The URelativeDateTimeFormatter object specifying the
456 * format conventions.
457 * @param offset
458 * The signed offset for the specified unit.
459 * @param unit
460 * The unit to use when formatting the relative
461 * date, e.g. UDAT_REL_UNIT_WEEK, UDAT_REL_UNIT_FRIDAY.
462 * @param result
463 * A pointer to a UFormattedRelativeDateTime to populate.
464 * @param status
465 * A pointer to a UErrorCode to receive any errors. In
466 * case of error status, the contents of result are
467 * undefined.
468 * @draft ICU 64
469 */
470U_DRAFT void U_EXPORT2
471ureldatefmt_formatToResult(
472 const URelativeDateTimeFormatter* reldatefmt,
473 double offset,
474 URelativeDateTimeUnit unit,
475 UFormattedRelativeDateTime* result,
476 UErrorCode* status);
477#endif /* U_HIDE_DRAFT_API */
478
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100479/**
480 * Combines a relative date string and a time string in this object's
481 * locale. This is done with the same date-time separator used for the
482 * default calendar in this locale to produce a result such as
483 * "yesterday at 3:45 PM".
484 *
485 * @param reldatefmt
486 * The URelativeDateTimeFormatter object specifying the format conventions.
487 * @param relativeDateString
488 * The relative date string.
489 * @param relativeDateStringLen
490 * The length of relativeDateString; may be -1 if relativeDateString
491 * is zero-terminated.
492 * @param timeString
493 * The time string.
494 * @param timeStringLen
495 * The length of timeString; may be -1 if timeString is zero-terminated.
496 * @param result
497 * A pointer to a buffer to receive the formatted result.
498 * @param resultCapacity
499 * The maximum size of result.
500 * @param status
501 * A pointer to a UErrorCode to receive any errors. In case of error status,
502 * the contents of result are undefined.
503 * @return
504 * The length of the formatted result; may be greater than resultCapacity,
505 * in which case an error is returned.
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200506 * @stable ICU 57
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100507 */
Fredrik Roubert0596fae2017-04-18 21:34:02 +0200508U_STABLE int32_t U_EXPORT2
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100509ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
510 const UChar * relativeDateString,
511 int32_t relativeDateStringLen,
512 const UChar * timeString,
513 int32_t timeStringLen,
514 UChar* result,
515 int32_t resultCapacity,
516 UErrorCode* status );
517
Fredrik Roubert8de051c2016-03-10 13:13:27 +0100518#endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION */
519
520#endif