I am trying to implement a date picker in my VB website. I am also using a database using LINQ. I have the following code to call the date picker.
<td>Start Date:</td>
<td>
<div>
<asp:Calendar ID="Calendar1" runat="server" Visible="False"></asp:Calendar>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
</div>
</td>
The table in the database has the following fields:
ProjectID (int)
ProjectName (vchar)
Description (vchar)
StartDate (datetime)
Any advice on how I can put in the datepicker and link it into the StartDate field in my database. Sorry if this is unclear. I'm just starting out. All suggestions welcome. Thanks
In my opinion you have here 3 possibilities. The simpliest is to bind it somewhere where you get data from datasource and just assigning SelectedDate property of calendar control to data from datasource:
Dim tomorrow As Date = Date.Today.AddDays(1)
Calendar1.TodaysDate = tomorrow
Calendar1.SelectedDate = Calendar1.TodaysDate
The second one is based on using DayRender event and you can find a good explanation about this method here
The last one was described in Dino Esposito's article for DevPro and can be used for the case when you need such control in many pages. So, he explain how to create a reusable user control with standard properties like DataSource, DataSourceID and DataBind method.
Related
lightning-input type = "date" picker's hover and active states to be darker color for WCAG
<lightning-input name="dob" class="validate dob" type="date" label="Date of Birth (mm/dd/yyyy) value="person.dob" date-style="short" onChange="checkDatesDOB" required
for the above date picker we need to apply dark background on the dates and month arrows (around the month) when hovered over or clicked on for accessibility. Can someone help how to style the above requirement.
Some articles say we need build custom date picker from scratch .. how to go about it ?
Or I read on here we can use loadStyle as static resource and then apply styles for inside levels .. I am not sure how the inside tags of date picker look like after clicking to bring up the date picker. Can you help with simple example using the loadStyles method or the other where a child style element is inserted below link
https://hellosnl.blogspot.com/2019/07/lwc-override-css-of-standard-lightning-components.html
I appreciate your time and help
Might help someone .. I found 2 ways to solve it based on this blog post -
https://hellosnl.blogspot.com/2019/07/lwc-override-css-of-standard-lightning-components.html
create a style element, assign style class body, the appendChild in the DOM
renderedCallback() {
const style = document.createElement('style');
style.innerText = c-hello-expressions .slds-card__header { background-color: #54C2B2; };
this.template.querySelector('lightning-card').appendChild(style);
}
loadStyles using the code in the blogpost above.
I also had asked for help on changing the date format of lightning input control and the solutions are -
The lightning-input type='date' control's date format can be changed by changing the public guest user's locale for the community site (Setup > Site (Not All Sites) > edit on corresponding site row > manage public settings > manage users > Public guest user ), based on the locales I checked for most of North America I found only m/d/yyyy and yyyy-mm-dd are supported.
Note, you can also use the dateStyle attribute on the control's html to use the medium (Oct 7th, 2022) and long (October 7th, 2022) formats.
But I wanted 'mm/dd/yyyy' and another way is to use -
2. use standard html input control of type = "date"
Example:
<label class="slds-form-element__label" for="date-input-id-default">Date</label>
<input type="date" id="start" name="trip-start"
value="2018-07-22" class="slds-input"
min="2018-01-01" max="2018-12-31">
I'm trying to use angular-bootstrap-calendar and create a calendar where a user can select multiple dates in one go and add an event to the selected range. So far, following the documentation, I can create a custom template for a monthly cell or allow a user to select a range of dates. Unfortunately, as soon as I try to mix the two things I cannot select the range anymore but the custom template is working fine. I have created the calendar in this way
<mwl-calendar
view="calendarView"
view-date="viewDate"
events="prices"
view-title="calendarTitle"
on-event-click="eventClicked(calendarEvent)"
on-event-times-changed="calendarEvent.startsAt = calendarNewEventStart; calendarEvent.endsAt = calendarNewEventEnd"
custom-template-urls="{calendarMonthCell: 'customMonthCell.html'}"
on-date-range-select="rangeSelected(calendarRangeStartDate, calendarRangeEndDate)"
cell-is-open="true"
cell-modifier="cellModifier(calendarCell)">
</mwl-calendar>
Can anyone show me a plunker working example please?
Plunker to the example http://plnkr.co/edit/VHkbUEkrOcmnhiPOPbc4
I'm trying to prevent the value of a model from updating in a form.
For example :
I have a payment details form that lists the user's saved information (name, address etc) along with the form that is used to edit the same information.
I've been experimenting using the :: for one time binding as I don't want the displayed information to changed when input controls are changed (but I obviously want the models updated values so i can send them to the server for processing).
How do I update the displayed model values after the server responds that the changes have been saved, are ok etc? I can't seem to find a way to update the one time binding (as I'm guessing this is fully the intended functionality).
So I guess my question boils down to :
How do I selectively update bindings on some controls but not others?
Actually you just want to display different vars.
You should try with a temporary model object (that is a copy of your object like "editedObject") and when you validate you will update the original object.
See it working in this plunker
The editing space :
<input ng-model="editCopy.value"> <button ng-click="validateChange()">Change</button>
The ng-repeat :
<td ng-repeat="item in items" ng-click="editItem(item)">
{{item.value}}
</td>
The functions :
$scope.editItem = function(item){
$scope.editCopy = angular.copy(item);
$scope.editingItem = item;
}
$scope.validateChange = function(){
$http.get('index.html').success(function(){
$scope.editingItem.value = $scope.editCopy.value;
});
}
Please accept my apologies if i had any mistakes in my post. This is my first post here. But, i am not new to StackOverflow. Correct me if any.
I am using angular-bootstrap-datetimepicker library from the below url:
Link to library
I am currently embedding the calender on the page.
I am using angular.js, moment.js, grunt and bower. Absolutely no issue loading the calender and can even select a date and display the selected date as well.
Here is the sample code:
<div>
Selected Date: {{ data.embeddedDate | date:'yyyy-MMM-dd' }}
<datetimepicker data-ng-model="data.embeddedDate" data-datetimepicker-config="{ startView:'day', minView:'day'}" />
</div>
I am trying to highlight today's date automatically when the datetimepicker shows on the page.
As you can see, in the config options, i could set the default view and min view.
Note: I tried to mimic the working code (till now) in Plunkr but, its not showing the calendar. I added all libraries as well. Anyways, that's just for idea only. If i could get the Plunkr working, i will update again.
Here is the link to Plunkr.
Any suggestions (regarding highlight today date by default) will be appreciated.
To get the directive to show todays date by default, you can set the value of data.embeddedDate in the controller through its scope, like so:
$scope.data = { embeddedDate: new Date() };
Working Plunkr
Can anyone help me to build a xpages mobile search?
I want a text field and a button that proceds a full text search on database and return a Dataview with the results.
Is there possible?
I don't know how to start this.
I think your approach with a dataview is the same with a repeat or just a normal view.
You have a text field. In data for the text field go to advanced and use a scoped variable. Try view scope, that should work. and give the variable a name (exampleValue)
<xp:inputText id="inputText6" value="#{viewScope.exampleValue}"></xp:inputText>
You now have some data that you can reference with viewScope.exampleValue
In the search parameter compute this value and put in viewScope.exampleValue
<xe:this.data>
<xp:dominoView var="view1" viewName="Your view name" search="#{javascript:viewScope.exampleValue}">
Then have a button that does a partial refresh on the dataview
<xp:button value="Refresh Search" id="button1" >
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="ID_of_area_to_refresh">
</xp:eventHandler></xp:button>
Take a look at this question too. I can't upvote this answer enough. Xpages search between 2 dates
You will also want to make sure you have initiated a ftindex, make sure you do that. You also want to make sure the FTindex is up to date, so put this code in some event somewhere.
database.updateFTIndex(true);
Here is the code you can use to clear a field.
<xp:button value="Label" id="button2"><xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="inputText1">
<xp:this.action>
<xp:modifyField name="httppwd" var="viewscope" value=""></xp:modifyField>
</xp:this.action></xp:eventHandler></xp:button>
Are you using the View control or the Data View? Only the Data View works with the mobile controls.