Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

225
Vistas
How to convert Gregorian or Timestamp date to persian date in the Higcharts in angular

I want the dates to be displayed in Persian on the Highcharts chart. I know you can use jalali-moment to convert the date to normal. Is there a way to do this in the Highcharts? I use Angular 12 and Highcharts 9.

 Highcharts.chart('lineChart', {

  chart: {
    scrollablePlotArea: {}
  },

  xAxis: {
    type: 'datetime',
    gridLineWidth: 1,
    labels: {
      align: 'left',
      x: 3,
      y: -3
    }
  },

  yAxis: [{
    title: {
      text: null
    },
    showFirstLabel: false
  }],
  series: [{
    type: 'line',
    data: [
      [
        1633209533000,
        3
      ],
      [
        1635796087000,
        3
      ],
      [
        1635882487000,
        6
      ],
      [
        1636055287000,
        4
      ],
      [
        1638466033000,
        8
      ],
      [
        1638479933000,
        6
      ]
    ]
  }]
});
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can use Highcharts dateFormats and jalali-moment.

Use this link to install jalali-moment

in Highcharts options use Highcharts.dateFormats

>   chartDateFormat() {
    Highcharts.dateFormats.a = (ts) => {
      return moment(ts).locale('fa').format('dddd');
    };
    Highcharts.dateFormats.A = (ts) => {
      return moment(ts).locale('fa').format('dddd');
    };
    Highcharts.dateFormats.d = (ts) => {
      return moment(ts).locale('fa').format('DD');
    };
    Highcharts.dateFormats.e = (ts) => {
      return moment(ts).locale('fa').format('D');
    };
    Highcharts.dateFormats.b = (ts) => {
      return moment(ts).locale('fa').format('MMMM');
    };
    Highcharts.dateFormats.B = (ts) => {
      return moment(ts).locale('fa').format('MMMM');
    };
    Highcharts.dateFormats.m = (ts) => {
      return moment(ts).locale('fa').format('MM');
    };
    Highcharts.dateFormats.y = (ts) => {
      return moment(ts).locale('fa').format('YY');
    };
    Highcharts.dateFormats.Y = (ts) => {
      return moment(ts).locale('fa').format('YYYY');
    };
    Highcharts.dateFormats.W = (ts) => {
      return moment(ts).locale('fa').format('ww');
    };
  }

From this link, you can view the codes online

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda