-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
1Replies
How to insert manually date with auto slash and with date picker both in one lightning-input in lwc ?
I am trying to build functionallity in the lightning-input lwc component, in which user can insert manually the date with auto slash functionallity or by date picker.
<template> <div class="btn-group"> <button type="button" class="btn btn-default dropdown-toggle example_disable_while_logging" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <ul class="dropdown-menu"> <li> <div class="input-group" style="display: inline-flex;"> <lightning-input id="dos_start" maxlength="10" onkeyup={checkValue} value={dDate} type="text" class="date-picker form-control" placeholder="Begin"></lightning-input> <span id="hoverOverAreal"> <a onclick={hoverOverAreal} html-log_this ="false"> <lightning-button-icon id="lnkimag1" style="margin-top: 8px;" icon-name="standard:date_input"></lightning-button-icon> <lightning-output-field style="width: 7em; margin-top: -15px;">(MMDDYYYY)</lightning-output-field> </a> </span> </div> </li> <li> <div class="input-group" style="display: inline-flex;"> <lightning-input id="dos_end" maxlength="10" value={eDate} onkeyup={checkValue} type="text" class="date-picker form-control" placeholder="End"></lightning-input> <span id="hoverOverArea2"> <a onclick={hoverOverArea2} html-log_this ="false"> <lightning-button-icon id="lnkimag2" style="margin-top: 8px;" icon-name="standard:date_input"></lightning-button-icon> <lightning-output-field style="width: 7em; margin-top: -15px;">(MMDDYYYY)</lightning-output-field> </a> </span> </div> </li> </ul> </button> </div> </template>
import { LightningElement, track } from 'lwc'; export default class CustomDatePicker extends LightningElement { @track edate= ""; checkValue(evt) { var str = evt.target.value; var stl = str.length; var char = ""; var c = ""; console.log('str: ' + str + ' len: ' + stl); if ( stl > 9 ) evt.preventDefault(); char = str; if ( stl == 2) char = str + "/"; if ( stl == 5) char = str + "/"; this.edate = char; console.log('this is char valueee:'+ char); var char; if(event.target.dataset.id === 'text'){ this.numberFieldValue = char; }else if(event.target.dataset.id === 'date'){ this.checkBoxFieldValue = char; } var dateInput = eDate ? eDate.which : window.event.keyCode; if(dateInput == 8){ dDate.char = dDate.char.substr(0, dDate.char.length); return; } var dateValue = dDate.char; var dateValueSplit = dateValue.split('/'); for(var a = 0; a< dateValueSplit.length; a++){ dateValueSplit[a] != dateValueSplit[a] + dateValueSplit[a]; if(dateValueSplit[a] != +dateValueSplit[a]){ dateValueSplit[a] = dateValueSplit[a].substr(0, dateValueSplit[a].length - 1); } } dateValue = dateValueSplit.join('/'); if(dateValue.length == 2 || dateValue.length == 5) dateValue += '/'; dDate.char = dateValue; } }
- Rajesh Kumar SF
- June 13, 2020
- Like
- 0
- Continue reading or reply
Custom help text to display on moushover to column header icon in datatable
I want to show custom help text on mouse hover to the icon in the column header of the datatable in lwc.
- Rajesh Kumar SF
- May 24, 2020
- Like
- 0
- Continue reading or reply
Error while submit the trail challange for pd1 maintanence summer '19
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Lead_Email: execution of BeforeInsert
caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, Email address is invalid: null: [toAddresses, null]
caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, Email address is invalid: null: [toAddresses, null]
- Rajesh Kumar SF
- December 04, 2019
- Like
- 0
- Continue reading or reply
How to display same logo inside the lightning component in different shape on different pages i.e. Home page,record page etc.
I created one lightning component, inside the component i have logo and some content, Now bussiness requirment is that whenever this component being display on different pages like home page, chatter, record page etc. then i want to change only shape of the logo as circular, rectanguler, polygonal etc.
- Rajesh Kumar SF
- April 06, 2019
- Like
- 0
- Continue reading or reply
How to insert manually date with auto slash and with date picker both in one lightning-input in lwc ?
I am trying to build functionallity in the lightning-input lwc component, in which user can insert manually the date with auto slash functionallity or by date picker.
<template> <div class="btn-group"> <button type="button" class="btn btn-default dropdown-toggle example_disable_while_logging" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <ul class="dropdown-menu"> <li> <div class="input-group" style="display: inline-flex;"> <lightning-input id="dos_start" maxlength="10" onkeyup={checkValue} value={dDate} type="text" class="date-picker form-control" placeholder="Begin"></lightning-input> <span id="hoverOverAreal"> <a onclick={hoverOverAreal} html-log_this ="false"> <lightning-button-icon id="lnkimag1" style="margin-top: 8px;" icon-name="standard:date_input"></lightning-button-icon> <lightning-output-field style="width: 7em; margin-top: -15px;">(MMDDYYYY)</lightning-output-field> </a> </span> </div> </li> <li> <div class="input-group" style="display: inline-flex;"> <lightning-input id="dos_end" maxlength="10" value={eDate} onkeyup={checkValue} type="text" class="date-picker form-control" placeholder="End"></lightning-input> <span id="hoverOverArea2"> <a onclick={hoverOverArea2} html-log_this ="false"> <lightning-button-icon id="lnkimag2" style="margin-top: 8px;" icon-name="standard:date_input"></lightning-button-icon> <lightning-output-field style="width: 7em; margin-top: -15px;">(MMDDYYYY)</lightning-output-field> </a> </span> </div> </li> </ul> </button> </div> </template>
import { LightningElement, track } from 'lwc'; export default class CustomDatePicker extends LightningElement { @track edate= ""; checkValue(evt) { var str = evt.target.value; var stl = str.length; var char = ""; var c = ""; console.log('str: ' + str + ' len: ' + stl); if ( stl > 9 ) evt.preventDefault(); char = str; if ( stl == 2) char = str + "/"; if ( stl == 5) char = str + "/"; this.edate = char; console.log('this is char valueee:'+ char); var char; if(event.target.dataset.id === 'text'){ this.numberFieldValue = char; }else if(event.target.dataset.id === 'date'){ this.checkBoxFieldValue = char; } var dateInput = eDate ? eDate.which : window.event.keyCode; if(dateInput == 8){ dDate.char = dDate.char.substr(0, dDate.char.length); return; } var dateValue = dDate.char; var dateValueSplit = dateValue.split('/'); for(var a = 0; a< dateValueSplit.length; a++){ dateValueSplit[a] != dateValueSplit[a] + dateValueSplit[a]; if(dateValueSplit[a] != +dateValueSplit[a]){ dateValueSplit[a] = dateValueSplit[a].substr(0, dateValueSplit[a].length - 1); } } dateValue = dateValueSplit.join('/'); if(dateValue.length == 2 || dateValue.length == 5) dateValue += '/'; dDate.char = dateValue; } }
- Rajesh Kumar SF
- June 13, 2020
- Like
- 0
- Continue reading or reply