Skip to content

Commit

Permalink
I fixed a pt-br import problem in the date-fns library
Browse files Browse the repository at this point in the history
  • Loading branch information
aline-borges committed Nov 16, 2020
1 parent 9b28b65 commit ffd039b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/screens/Locations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { LinearGradient } from 'expo-linear-gradient';
import { Feather } from '@expo/vector-icons';
import { SafeAreaView } from 'react-native-safe-area-context';
import { format, utcToZonedTime } from 'date-fns-tz';
import { getHours, getMinutes } from 'date-fns';
import { getHours, getMinutes, es, formatRelative, subDays } from 'date-fns';
import 'date-time-format-timezone';

import OpenWeather, { getOneCall } from '../../services/apis/openWeather';
Expand Down Expand Up @@ -41,13 +41,13 @@ const Locations = ({ navigation }) => {
const timezone = response2.timezone;

const newDate = utcToZonedTime(date, timezone);

const newHour = getHours(newDate, {locale: 'pt-BR'});
console.log(newDate)
const newHour = getHours(newDate);
const newMinutes = getMinutes(newDate);
const h = newHour < 10 ? `0${newHour}` : newHour;
const m = newMinutes < 10 ? `0${newMinutes}` : newMinutes;
const hour = newHour < 10 ? `0${newHour}` : newHour;
const minutes = newMinutes < 10 ? `0${newMinutes}` : newMinutes;

const newTime = `${h}:${m}`;
const newTime = `${hour}:${minutes}`;

const datas = {data: response, data2: response2}
const location = {
Expand Down

0 comments on commit ffd039b

Please sign in to comment.