I am using this plugin:
http://tedserbinski.com/jcalendar/index.html
The plugin is supposed to accept a user defined startdate, but I cant manage to get it to work.
This is the header of the js file:
var _drawCalendar = function(dateIn, a, day, month, year) {
var today = new Date();
if (dateIn == undefined) {
// start from this month.
d = new Date(today.getFullYear(), today.getMonth(), 1);
year.val(today.getFullYear());
month.val(today.getMonth()+1);
day.val(today.getDate());
}
else {
// start from the passed in date
d = dateIn;
d.setDate(1);
}
And i am calling the calendar plug with the following line, that actually is missing something. I have tried hundreds of diffrent code snippets, but I have gived up :(
$('fieldset.jcalendar').jcalendar();
Best regards, Joakim
Any particular reason you aren't using the DatePicker that comes with jQuery UI? The page you linked even says that the project has been superceded by jQuery UI.
Related
I have found 2 issues that relate to the upgrade of Alloy to 1.8.3,
I think both are a part of another bug thats been reported regarding transform and data binding, https://jira.appcelerator.org/browse/ALOY-1477
I didn't want to just report it as a bug incase its down to something i'm doing??
1st one, I originally was referencing alloy_id in the transform for a list
but that started produced an error saying alloy_id could not be found, changing it to $model works but not sure if thats how we are supposed to do it now or its part of the above bug?
xml code (part)
<TableViewRow id="categoriesRow" UCATID="{UCATID}"
ParentID="{ParentID}" CategoryID="{CategoryID}" catName= {catName}"
model="$model" hasDetail="{hasDetail}">
<!-- TableViewRow id="categoriesRow" UCATID="{UCATID}"
ParentID="{ParentID}" CategoryID="{CategoryID}" catName="{catName}"
model="{alloy_id}" hasDetail="{hasChildren}"-->
<Label id="rowTitle">{CategoryName}</Label>
</TableViewRow>
The 2nd one is that setting the hasDetail to true or false (a boolean) for a table row to show there is more detail, this works on the iOS app by displaying the little icon fine in all versions so far,
however before the upgrade, validating the reference as a boolean worked, but now you have to reference it as a string
this can't be right??
controller.js code
function transformFunction(model) {
var transform = model.toJSON();
transform.catName = transform.CategoryName;
transform.hasDetail = transform.hasChildren == "0" ? false : true;
return transform;
}
$.winProdCats.addEventListener('click', function(e) {
Ti.API.info('e.row.hasDetail: ' + e.row.hasDetail );
var iHaveBoolean = e.row.hasDetail;
Ti.API.info('iHaveBoolean: ' + iHaveBoolean );
//if(e.row.hasDetail){ //this don't work as a boolean anymore only as a string
if(iHaveBoolean == "true"){
parentID = e.row.CategoryID;
getData();
filterFunction(library);
updateUI();
} else {
Ti.App.fireEvent('app:products:category:selected', {
UCATID : e.row.UCATID,
catName : e.row.catName,
ParentID : e.row.ParentID,
CategoryID : e.row.CategoryID
});
Alloy.Globals.navGroup.closeWindow($.winProdCats);
}
});
an error saying alloy_id could not be found
This is ALOY-1477, fixed in Alloy 1.8.4
//if(e.row.hasDetail){ //this don't work as a boolean anymore only as a string
This is ALOY-1480, fix to be merged for Alloy 1.8.x next week, shipping with AppC CLI 5.3.0 end of April
I've created an object previously that I'm now trying to update in an "edit" screen
The id of the object is correct (as it correctly queries earlier in the activity to update the text labels. This should save when a button is clicked.
ParseQuery<ParseObject> query = ParseQuery.getQuery("Product");
Intent i = getIntent();
String queryString = i.getStringExtra("id");
query.getInBackground(queryString, new GetCallback<ParseObject>() {
public void done(ParseObject editProduct, ParseException e) {
if (e == null) {
editProduct.put("productName", ProductName.getText().toString());
editProduct.put("ISDN", ISDN_text.getText().toString());
editProduct.put("expiry", expiry_date.getText().toString());
editProduct.put("type", spinnercategory.getSelectedItem().toString());
editProduct.put("quantity", quantity.getText().toString());
editProduct.put("username", "Admin");
editProduct.put("shoppingList", true);
editProduct.put("mainList", false);
editProduct.saveInBackground();
}
}
});
This is lifted from the Parse Android developers guide, but doesn't appear to be working. Any suggestions
Figured it out. Sort of.
editProduct.put("expiry", expiry_date.getText().toString()); is the line that's breaking it. I'm trying to pass a string to what is defined as a date at the backend, which apparently cancels the whole save operation.
Commented this out in my solution for now until I can fix the issue with the date
How can I change default time filter duaration in Kibana 4.0?
By default it is 15 minutes from now. It return default each time when I open new session Kibana.
Find index.js in [YourKibanaLocation]\src\public\index.js
and look for Timefilter() function (my Kibana version has it at string 115480).
After finding the function, change default value for timeDefaults to your liking and save index.js.
Mine looked like this:
BEFORE
function Timefilter() {
Timefilter.Super.call(this);
var self = this;
self.enabled = false;
var timeDefaults = {
from: 'now-15m',
to: 'now'
};
AFTER
function Timefilter() {
Timefilter.Super.call(this);
var self = this;
self.enabled = false;
var timeDefaults = {
from: 'now-24h',
to: 'now'
};
You don't have to restart Kibana after that, just refresh your Kibana page.
PS. Sorry for unformatted answer, I'll change later, when not on mobile.
Click on the top right corner[Last 15 minutes]. You will get a dropdown from where you can change the time.
In Kibana 4.6.1, the default time can be changed from 15 minutes to ,for example, 24 hours easily.
Location of file to change:
kibanaDir/optimize/bundles/kibana.bundle.js
search for 'timepicker:timeDefaults', change the time from 15mto 24h, save the file and refresh the browser. You are done.
I've built out a solution with multiple masterpages/page layouts as features for a set of SharePoint 2010 publishing site collections.
One consistent request is to be able to grab the page owner contact email and display it in the footer of the masterpage. If the page Contact Email isn't entered, then I need to grab the page owner data from the People Picker, and grab the contact email from that.
I don't want to have to add every single publishing page layout to my solution, and manually add the Contact Email column into a place holder, that seems crazy to me. I figure there has to be a way to grab the page owner data from within the masterpage, but I can't figure it out. I started looking at the jQuery SPServices library, but so far I haven't been able to figure it out there, either.
Does anyone have any experience in adding a contact email using the supplied page owner contact information in the Masterpage?
OK, in order to resolve this, you need jQuery 1.7.x+ and the SPServices jQuery library version 0.7.2 or greater installed on your site.
Use GetListItems as the operation from SPServices.
I'm searching for pages within the Pages directory, so listName is "Pages".
The CAML View Fields are basically the columns for PublishingContactEmail and PublishingContact. I found those using u2u's CAML builder version 4.0.0.0
The ows_ variables can be found in the xml view of the POST object in firebug.
The ows_PublishingContact returns a long nasty string of the contact's information. Fortunately the email address is surrounded by ,#, which made splitting it into an array and then searching for an email # easy, but that's why that's there.
function get_page_contact_email() {
var thisPageID = _spPageContextInfo.pageItemId;
var e;
$().SPServices({
operation: "GetListItems",
async: false,
listName: "Pages",
CAMLViewFields: "<ViewFields><FieldRef Name='PublishingContactEmail' /><FieldRef Name='PublishingContact' /></ViewFields>",
CAMLQueryOptions: "<QueryOptions><ExpandUserField>True</ExpandUserField></QueryOptions>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function () {
if (thisPageID == $(this).attr("ows_ID")) {
if ($(this).attr("ows_PublishingContactEmail")) { // if page email is set
e = $(this).attr("ows_PublishingContactEmail");
} else if ($(this).attr("ows_PublishingContact")) { //otherwise use contact info
var contact = $(this).attr("ows_PublishingContact").split(",#");
for (var c = 0; c < contact.length; c++) {
if (contact[c].indexOf("#") != -1) {
e = contact[c];
}
}
} else { //or nothing is set.
e = false;
}
}
});
}
});
return e;
}
I've been trying to do this all morning. Anyone have a code snippet (C#) showing how to update an "activity" within CRM via the webservice?
I can CreateReadUpdateDelete with entities, but I'm not sure how to do it with Activities.
Can't find anything on google either...
What are you specifically looking to update? Basically, updating an activity is just like updating any other entity, you just have to use the task entity.
public void CloseTask(CrmService crmsvc, Guid activityid, DateTime start, DateTime end)
{
ColumnSet cols = new ColumnSet();
cols.Attributes = new string[] { "activityid", "statecode" };
task tsk = (task)crmsvc.Retrieve(EntityName.task.ToString(), activityid, cols);
if(tsk.statecode.Value != TaskState.Open)
return;
tsk.actualstart = new CRMDateTime();
tsk.actualstart.value = start.ToString();
tsk.actualend = new CRMDateTime();
tsk.actualend.value = end.ToString();
crmsvc.Update(tsk);
SetStateTaskRequest state = new SetStateTaskRequest();
state.EntityId = activityid;
state.TaskState = TaskState.Completed;
state.TaskStatus = -1; // Let MS CRM decide this property;
SetStateTaskResponse stateSet = (SetStateTaskResponse)crmsvc.Execute(state);
}
Edit: added some sample code. note, I had to modify what I had to strip some proprietary code, so I don't know if this will actually compile. It's close though.
We can also update a Custom Workflow Activity Using Assembly Versioning. Below link gives more information:
http://msdn.microsoft.com/en-us/library/gg328011.aspx