ionic3

Typescript Invalid date with Ionic 3 simulator and Firefox

假装没事ソ 提交于 2020-01-05 04:10:09
问题 I have this function with MomentJs CreateFormat(date: string, time: string): string { let now = moment(date + " " + time, "YYYY-MM-DD H:m:s z").toDate(); return moment(now, "YYYY-MM-DD H:m:s z").format("HH:mm"); } I got this result : 7:39 pm i want to display it like this 19:39 回答1: I highly recommend using momentJs with your Ionic 3 app.Then you won't have any browser specific errors like you have now. npm install moment .ts import moment from 'moment'; let now = moment().format('LLLL');

How to prevent checkbox from selecting all when setting its variable to true or false?

拈花ヽ惹草 提交于 2020-01-04 14:16:56
问题 I made an accordion list with ionic [v3] as you can see in the link video tutorial the select option menu is not in the .html file. The list items in the menu are from .json file as you can see in my .ts file form.html ..... <ion-item *ngFor="let item of child.children" detail-none class="child-item" text-wrap no-lines> <ion-label>{{ item.name }} <p style="color: #0077ff;">{{ selected }}</p> </ion-label> <ion-checkbox item-end [(ngModel)]="value" (click)="tofix(item)"></ion-checkbox> </ion

ionic 3 -Keyboard pushes the whole screen up

不羁岁月 提交于 2020-01-04 14:14:28
问题 I build ionic 3 app. I have inputs field and when I press on them to begin to type anything the screen changed.. before when I press on any input field the screen changed(it's test also in real device) 回答1: You can fix this problem by adding this style to app.scss: ion-grid { min-height: 100%; } The keyboard resizes Ionic's grid system if you didn't define its minimum height. 回答2: Take a look at the native keyboard to prevent the keyboard from pushing things up. keyboard.disableScroll(bool);

Moment.js plugins in Ionic2/Cordova typescript project

无人久伴 提交于 2020-01-04 07:25:10
问题 In my Ionic 2 project written in Typescript I use moment.js library. I import it using code snippet: import * as moment from 'moment'; After I do so, in my component I can use moment normally, ie: let endDate = moment(data.endDate); however, now I want to use one of plugins dedicated to moment.js - moment-weekday-calc from this repo: https://github.com/andruhon/moment-weekday-calc I've installed plugin via npm, but I am not able to make it running. I've tried: import * as moment from 'moment'

Custom Fonts in Ionic3

不打扰是莪最后的温柔 提交于 2020-01-04 05:36:19
问题 I am using Ionic3 : Your system information: Cordova CLI: 6.4.0 Ionic Framework Version: 3.0.1 Ionic CLI Version: 2.1.18 Ionic App Lib Version: 2.1.9 Ionic App Scripts Version: 1.3.0 ios-deploy version: Not installed ios-sim version: Not installed OS: macOS Sierra Node Version: v6.9.4 Xcode version: Xcode 8.3.1 Build version 8E1000a I have the following font: Ormont_Light.ttf As you can see above, I try apply this new font in the app.scss file. However, I cannot seem to make it take effect.

Module '“ ”' has no exported member 'NativeGeocoderReverseResult' in ionic 3 Geolocation

南笙酒味 提交于 2020-01-04 03:16:31
问题 Module '" "' has no exported member 'NativeGeocoderReverseResult'. L13: import { Geolocation } from '@ionic-native/geolocation/ngx'; L14: import { NativeGeocoder, NativeGeocoderOptions,NativeGeocoderReverseResult} Error In Console getUserLocation(){ let options: NativeGeocoderOptions = { useLocale: true, maxResults: 5 }; this.geolocation.getCurrentPosition().then(resp => { this.nativeGeocoder.reverseGeocode(resp.coords.latitude, resp.coords.longitude, options) .then((result:

Default sound not playing in Android v9 but working on Andoird v7 - ionic v3 cordova push plugin

烈酒焚心 提交于 2020-01-04 02:02:10
问题 I am using FCM to send notification on my app. below are the screenshots, how I am doing. As you can see I enabled the sound, and it is working on Android v7 but not on my other device with Android v9 Here is the code on my ionic app... pushSetup() { this.push.hasPermission().then((res: any) => { if (res.isEnabled) { console.log("We have permission to send push notifications"); } else { console.log("We do not have permission to send push notifications"); } }); // Create a channel (Android O

Changing Ionic Menu side dynamically

霸气de小男生 提交于 2020-01-03 17:34:56
问题 I'm trying to change the Ionic 3 Menu side dynamically once user changes the language. For RTL languages menu needs to be on the right, by default it's set on left. I subscribe to TranslateService from @ngx-translate/core event when the language changes app.components.ts : this.translate.onLangChange.subscribe((event: LangChangeEvent) => { console.info(`Language change to ${event.lang}`); this.isRTL = event.lang == 'ar' || event.lang == 'fa'; if (event.lang == 'ar' || event.lang == 'fa') {

Ionic 3 : Android add platform fails after installing cordova-plugin-camera and Native Web-intent

拥有回忆 提交于 2020-01-03 17:11:20
问题 And first of all, thank you for the time you'll take to help me! Summary: Tried to add the cordova-plugin-camera to my ionic 3 project. After many fails and finally a success, now my app does not build on my android anymore. -------- START EDIT -------- After much tests, it seems that there is a conflict/issue when I have both plugins camera and web-intent installed. Both plugins are from Ionic Native: camera plugin : cordova-plugin-camera web-intent : com-darryncampbell-cordova-plugin-intent

Ionic PWA get version number from config.xml

不问归期 提交于 2020-01-03 17:03:07
问题 I want to show the version number from config.xml in an Ionic PWA. It is easy to get it done for ios/android builds using ionic native app version plugin. But what is a good approach for a PWA build (npm run build --release --prod)? 回答1: Ok, so if cordova-plugin-app-version is not available on PWA, an alternative way to access to config.xml file is using a grunt task that copy the version to your templates (As you know, on Ionic the config.xml file is not placed on a "servable" location, so