Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make old timestamp format "DD.MM.YY" configurable #186

Closed
yuchangyuan opened this issue Jul 10, 2020 · 1 comment
Closed

Make old timestamp format "DD.MM.YY" configurable #186

yuchangyuan opened this issue Jul 10, 2020 · 1 comment

Comments

@yuchangyuan
Copy link

Telega Setup

OS: Linux xps13 4.19.115 #1-NixOS SMP Mon Apr 13 08:45:17 UTC 2020 x86_64 GNU/Linux
Emacs: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10, cairo version 1.16.0)
Telega: telega v0.5.4 (TDLib version 1.6.0)

Install method: NixOS

Current Behavior

timestamp not in current week will always format to "DD.MM.YY", its better to be able to change to "YY-MM-DD" or "YY/MM/DD" or other format.

Steps to Reproduce

  1. open any chat with history more than 1week.
  2. timestamp will show as "DD.MM.YY" format.

Possible Solution

use add-function to override telega-ins--date

@zevlg
Copy link
Owner

zevlg commented Dec 28, 2020

Use this in your configuration to get YY-MM-DD formatting:

(defun my-date-ins (orig-ins-func timestamp)
  (telega-ins
   (replace-regexp-in-string
    "\\." "-" (telega-ins--as-string
               (funcall orig-ins-func timestamp)))))

(advice-add 'telega-ins--date :around 'my-date-ins)

@zevlg zevlg closed this as completed Dec 28, 2020
zevlg added a commit that referenced this issue Mar 1, 2021
To format "old" dates in telega

fixes #186, fixes #260

Version -> 0.7.22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants