Add an undo button to the git panel (#24593)

Also prep infrastructure for pushing a commit

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
This commit is contained in:
authored and GitHub committed 2025-02-12 15:57:08 -07:00
1 parent e9c2e8d61b
commit 2b6d7ac013
41 files changed
+1437 -738

No files matched your search

+13 -11
View File
@@ -24,19 +24,21 @@ pub fn format_localized_timestamp(
) -> String {
let timestamp_local = timestamp.to_offset(timezone);
let reference_local = reference.to_offset(timezone);
format_local_timestamp(timestamp_local, reference_local, format)
}
/// Formats a timestamp, which respects the user's date and time preferences/custom format.
pub fn format_local_timestamp(
timestamp: OffsetDateTime,
reference: OffsetDateTime,
format: TimestampFormat,
) -> String {
match format {
TimestampFormat::Absolute => {
format_absolute_timestamp(timestamp_local, reference_local, false)
}
TimestampFormat::EnhancedAbsolute => {
format_absolute_timestamp(timestamp_local, reference_local, true)
}
TimestampFormat::MediumAbsolute => {
format_absolute_timestamp_medium(timestamp_local, reference_local)
}
TimestampFormat::Relative => format_relative_time(timestamp_local, reference_local)
.unwrap_or_else(|| format_relative_date(timestamp_local, reference_local)),
TimestampFormat::Absolute => format_absolute_timestamp(timestamp, reference, false),
TimestampFormat::EnhancedAbsolute => format_absolute_timestamp(timestamp, reference, true),
TimestampFormat::MediumAbsolute => format_absolute_timestamp_medium(timestamp, reference),
TimestampFormat::Relative => format_relative_time(timestamp, reference)
.unwrap_or_else(|| format_relative_date(timestamp, reference)),
}
}