Skip to content

Instantly share code, notes, and snippets.

View Sampath-Lokuge's full-sized avatar
🏠
Working from home

Sampath Lokuge Sampath-Lokuge

🏠
Working from home
View GitHub Profile
Ionic Native plugin: http://ionicframework.com/docs/native/firebase/
base-page.ts
-------------
import { Firebase } from "@ionic-native/firebase";
export abstract class BasePage {
this.remainingAmount = this.totalOfBudgetAndContingency - spent;
this.paidPercentage = (this.amountPaid / this.totalOfBudgetAndContingency) * 100;
if (this.paidPercentage > 80) {
this.remainingPercentageExcludingPaid = 0;
this.contingencyPercentage = (totalContingency / this.totalOfBudgetAndContingency) * 100;
this.paidPercentage = 100 - this.contingencyPercentage;
} else {
this.remainingPercentageExcludingPaid = (this.remainingAmount / this.totalOfBudgetAndContingency) * 100;
this.contingencyPercentage = (totalContingency / this.totalOfBudgetAndContingency) * 100;
}
{
"name": "renoTracker",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
Multi Budget
@Sampath-Lokuge
Sampath-Lokuge / Chart
Last active October 31, 2017 02:26
Chart - 30-10-2017
Chart
@Sampath-Lokuge
Sampath-Lokuge / Photo
Created November 1, 2017 04:34
Photo
Photo
Token
async scheduleNotification(data: Transaction) {
let notifications: any[] = [];
notifications = await this.storage.get(LocalStorage.NOTIFICATIONS);
let firstNotificationTime = new Date(data.dueOn);
firstNotificationTime.setDate(firstNotificationTime.getDate());
firstNotificationTime.setHours(20);
firstNotificationTime.setMinutes(23);
firstNotificationTime.setSeconds(0);
const id = random(1, 1000);
let notification = {
//schedule Notification
async scheduleNotification(data: Transaction) {
let notifications: Notification[] = [];
notifications = await this.storage.get(LocalStorage.NOTIFICATIONS);
let firstNotificationTime = new Date(data.dueOn);
firstNotificationTime.setDate(firstNotificationTime.getDate());
firstNotificationTime.setHours(21);
firstNotificationTime.setMinutes(23);
firstNotificationTime.setSeconds(0);
const id = random(1, 1000);