mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-07 21:10:00 +00:00
fix(ssh/settings): formats date value according to locale rules (#10468)
This commit is contained in:
parent
af5d3b729b
commit
7ac85a329e
@ -36,7 +36,7 @@ export { TabsService, NewTabParameters, TabComponentType } from '../services/tab
|
||||
export { UpdaterService } from '../services/updater.service'
|
||||
export { VaultService, Vault, VaultSecret, VaultFileSecret, VAULT_SECRET_TYPE_FILE, StoredVault, VaultSecretKey } from '../services/vault.service'
|
||||
export { FileProvidersService } from '../services/fileProviders.service'
|
||||
export { LocaleService } from '../services/locale.service'
|
||||
export { LocaleService, TabbyFormatedDatePipe } from '../services/locale.service'
|
||||
export { TranslateService } from '@ngx-translate/core'
|
||||
export * from '../utils'
|
||||
export { UTF8Splitter } from '../utfSplitter'
|
||||
|
@ -43,7 +43,7 @@ import { AppService } from './services/app.service'
|
||||
import { ConfigService } from './services/config.service'
|
||||
import { VaultFileProvider } from './services/vault.service'
|
||||
import { HotkeysService } from './services/hotkeys.service'
|
||||
import { CustomMissingTranslationHandler, LocaleService } from './services/locale.service'
|
||||
import { CustomMissingTranslationHandler, LocaleService, TabbyFormatedDatePipe } from './services/locale.service'
|
||||
import { CommandService } from './services/commands.service'
|
||||
|
||||
import { NewTheme } from './theme'
|
||||
@ -130,6 +130,7 @@ const PROVIDERS = [
|
||||
DropZoneDirective,
|
||||
CdkAutoDropGroup,
|
||||
ProfileIconComponent,
|
||||
TabbyFormatedDatePipe,
|
||||
],
|
||||
exports: [
|
||||
AppRootComponent,
|
||||
@ -144,6 +145,7 @@ const PROVIDERS = [
|
||||
TranslateModule,
|
||||
CdkAutoDropGroup,
|
||||
ProfileIconComponent,
|
||||
TabbyFormatedDatePipe,
|
||||
],
|
||||
})
|
||||
export default class AppModule { // eslint-disable-line @typescript-eslint/no-extraneous-class
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { registerLocaleData } from '@angular/common'
|
||||
import { Injectable, Pipe, PipeTransform } from '@angular/core'
|
||||
import { formatDate, registerLocaleData } from '@angular/common'
|
||||
import { TranslateService, MissingTranslationHandler } from '@ngx-translate/core'
|
||||
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'
|
||||
|
||||
@ -257,3 +257,15 @@ export class LocaleService {
|
||||
return this.locale
|
||||
}
|
||||
}
|
||||
|
||||
@Pipe({
|
||||
name: 'tabbyDate',
|
||||
})
|
||||
export class TabbyFormatedDatePipe implements PipeTransform {
|
||||
|
||||
constructor (private locale: LocaleService) {}
|
||||
|
||||
transform (date: string): string {
|
||||
return formatDate(date, 'medium', this.locale.getLocale())
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
|
||||
div {{cfg.name}}
|
||||
small.text-muted(
|
||||
translate='Modified on {date}',
|
||||
[translateParams]='{date: cfg.modified_at|date:"medium"}'
|
||||
[translateParams]='{date: cfg.modified_at|tabbyDate}'
|
||||
)
|
||||
.me-auto
|
||||
button.btn.btn-link.ms-1(
|
||||
|
@ -145,4 +145,5 @@ export class ConfigSyncSettingsTabComponent extends BaseComponent {
|
||||
openTabbyWebInfo () {
|
||||
this.platform.openExternal('https://github.com/Eugeny/tabby-web')
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,5 +8,5 @@
|
||||
)
|
||||
div(*ngFor='let release of releases')
|
||||
h1 {{release.name}}
|
||||
.text-muted {{release.version}} / {{release.date|date:'mediumDate'}}
|
||||
.text-muted {{release.version}} / {{release.date|tabbyDate}}
|
||||
section([fastHtmlBind]='release.content')
|
||||
|
@ -45,4 +45,5 @@ export class ReleaseNotesComponent extends BaseTabComponent {
|
||||
onScrolled () {
|
||||
this.loadReleases(this.lastPage + 1)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -61,5 +61,5 @@
|
||||
div {{item.name}}
|
||||
.me-auto
|
||||
.size(*ngIf='!item.isDirectory') {{item.size|filesize}}
|
||||
.date {{item.modified|date:'medium'}}
|
||||
.date {{item.modified|tabbyDate}}
|
||||
.mode {{getModeString(item)}}
|
||||
|
@ -273,4 +273,5 @@ export class SFTPPanelComponent {
|
||||
close (): void {
|
||||
this.closed.emit()
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user