I don't understand your Pair example. What is T there and how does that make it possible to define a fun formatStyled(x: AtLeastYear) which knows how to display (with styles) a ZonedDateTime vs. LocalDateTime vs. YearMonth vs. Year?Or how about a date picker where the doctor can e...
For formats that are used for both parsing and formatting, it may still help to clearly indicate the format that will be used for formatting, without having to sift through parsing-specific behavior, and alternativeParsing does that. Let's collect more feedback and see how widespread the ...
fun getDaysOfWeek(): Array<String?> { val dateFormat = SimpleDateFormat("EEEEE\ndd", Locale.getDefault()) val calendar = Calendar.getInstance() calendar.firstDayOfWeek = Calendar.MONDAY calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY) val days = arrayOfNulls<String>(7) for (i in 0.....
如何使用 kotlinx.datetime KMM 库获取本周的日期? 例如。我想获取本周日期的列表,例如: (“星期一,07”,“星期二,08”,“星期三,09”,...) 这是使用Calendar的类似实现: fun getDaysOfWeek(): Array<String?> { val dateFormat = SimpleDateFormat("EEEEE\ndd", Locale.getDefault()) val calendar = ...
如何使用 kotlinx.datetime KMM 库获取本周的日期? 例如。我想获取本周日期的列表,例如: ( “星期一,07”, “星期二,08”, “星期三,09”,...) 这是使用Calendar 的类似实现: fun getDaysOfWeek(): Array<String?> { val dateFormat = SimpleDateFormat("EEEEE\ndd", Locale.getDefault()) ...
Hello, I think it'd be great to have natively the ability to know which week number a particular date is from. It's very easy to do with GregorianCalendar in the JVM or Android (calendar.get(Calendar.WEEK_OF_YEAR)), but I see no such fac...
We could consider that this requires an explicit multi-step parsing, but this kind of format doesn't seem reasonable to parse as "just anInstant", and we don't have a representation forInstant+timezone (and I believe the idea is that we don't want to). This is why I think the pars...
Even though it's not strictly part of this library, it could still benefit from DateTimeFormat formatting capabilities. Please share your use cases and suggestions here.dkhalanskyjb added the formatters label Feb 29, 2024 Sign up for free to join this conversation on GitHub. Already have an ...