question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set locale not working

See original GitHub issue

I’m submitting a … (check one with “x”)

[ X ] Bug report 
[ ] Feature request
[ ] Other, please describe

Tell about your platform

  • flatPickr version : 4.5.7
  • Vue.js version : 2.0.5
  • Browser name and version : Chrome 72.0.3626
  • This package version : x.x.x

Current behavior

Importing and setting the locale not working. I’m trying to set the Spanih locale but it dosen’t work

Expected behavior set the flatpickr

import flatpickr from 'flatpickr'
const Spanish = require('flatpickr/dist/l10n/es');
flatpickr.localize(Spanish);

import vueFlatPickr from 'vue-flatpickr-component';
import 'flatpickr/dist/flatpickr.css';

add the config to the elements (tied two different but anyone of the work form me)

customJobHous: {
        start: {
          time: null,
          dateFormat: 'H:i',
          wrap: true,
          enableTime: true,
          enableSeconds: false,
          noCalendar: true,
          time_24hr: true,
          locale: Spanish,
          onClose: (selectedDates, dateStr) => {
            this.changeTime('start', dateStr);
          }
        },
        end: {
          time: null,
          dateFormat: 'H:i',
          wrap: true,
          enableTime: true,
          enableSeconds: false,
          noCalendar: true,
          time_24hr: true,
          locale: Spanish,
          onClose: (selectedDates, dateStr) => {
            this.changeTime('end', dateStr);
            this.validJobTemplateHours();
          }
        }
      }
<vue-flat-pickr
	class="form-control jobTemplateHour flat-date-picker"
	:placeholder="langStartDate"
	:config="customJobDate.start"
	v-model="form.dateStart"
	@on-change="onStartChange"
>
</vue-flat-pickr>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ankurk91commented, Mar 7, 2019

Try importing locale like this

https://github.com/ankurk91/vue-flatpickr-component/blob/eeab13f52a5c48e72b063c07b626d6be5bd07fe9/examples/App.vue#L201

Read the doc on how to import locale properly. https://flatpickr.js.org/localization/

// right  way to import 
const Russian = require("flatpickr/dist/l10n/ru.js").default.ru;
0reactions
MarFelixcommented, Jan 23, 2020

Try importing locale like this

vue-flatpickr-component/examples/App.vue

Line 201 in eeab13f

import {Hindi as HindiLocale} from ‘flatpickr/dist/l10n/hi.js’; Read the doc on how to import locale properly. https://flatpickr.js.org/localization/

// right way to import const Russian = require(“flatpickr/dist/l10n/ru.js”).default.ru;

Esta es la manera correcta de hacerlo Gracias @ankurk91

Read more comments on GitHub >

github_iconTop Results From Across the Web

PHP setlocale has no effect - Stack Overflow
I wanted to translate dates to Spanish, and it was working on my localhost but not in the server (Ubuntu 18). It turned...
Read more >
How do I fix my locale issue? - Ask Ubuntu
First run locale to list what locales currently defined for the current user account: $ locale LANG=C LANGUAGE= LC_CTYPE=fi_FI.
Read more >
PHP setlocale and strftime Not Working - DevAnswers.co
In this article we will install a new locale using dpkg-reconfigure to resolve problems with PHP setlocale and strftim.
Read more >
Problem of Can't set locale; make sure $LC_* and $LANG are ...
Run dpkg-reconfigure locales as root, select the locales you want in the list (with your settings, you need en_GB and en_US.UTF-8 — I...
Read more >
setlocale - Manual - PHP
If your system doesn't show any installed locales by "locale -a", try installing them by "dpkg-reconfigure locales" (on debian).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found