GithubHelp home page GithubHelp logo

Translate option. about ionic-calendar HOT 2 CLOSED

Alfonsibo avatar Alfonsibo commented on July 29, 2024
Translate option.

from ionic-calendar.

Comments (2)

twinssbc avatar twinssbc commented on July 29, 2024

@Alfonsibo I don't quite get which part of the title do you need to translate.
In the month view, it has below three options can control the text displayed in the month view

  1. formatMonthTitle: control the title of that view, the default value is 'MMMM yyyy'
  2. formatDay: control the text displayed for each day, the default value is 'dd'
  3. formatDayHeader: control the text displayed in the header of the date table, the default value is 'EEE'

So you can change the format of month title as below:

            <calendar ng-model="calendar.currentDate" calendar-mode="calendar.mode" event-source="calendar.eventSource"
                      range-changed="reloadSource(startTime, endTime)"
                      event-selected="onEventSelected(event)" title-changed="onViewTitleChanged(title)"
                      time-selected="onTimeSelected(selectedTime)" formatMonthTitle='MMMM yyyy'></calendar>

from ionic-calendar.

Alfonsibo avatar Alfonsibo commented on July 29, 2024

I fixed my problem. Just want translate the text in viewTitle from April to Abril in the month view. I did it changing the value of $locale.DATETIME_FORMATS.MONTH and SHORTDAY for my local vars values. It's working fine for me.

switch(idioma) { case 'es_ES': $locale.DATETIME_FORMATS.MONTH=trads.es_ES.MONTH; $locale.DATETIME_FORMATS.SHORTDAY=trads.es_ES.SHORTDAY; break; case 'en_EN': $locale.DATETIME_FORMATS.MONTH=trads.en_GB.MONTH; $locale.DATETIME_FORMATS.SHORTDAY=trads.en_GB.SHORTDAY; break; }

Thanks for the help!

from ionic-calendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.